Skip to content

Commit 8ca9ede

Browse files
committed
v4.0.0
1 parent e8e27a5 commit 8ca9ede

File tree

8 files changed

+2177
-577
lines changed

8 files changed

+2177
-577
lines changed

Diff for: CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5-
### [3.5.12](https://github.com/MaximKing1/BLWebhooks/compare/v3.5.11...v3.5.12) (2024-10-22)
5+
### [4.0.0](https://github.com/MaximKing1/BLWebhooks/compare/v3.5.11...v4.0.0) (2024-10-22)
6+
* **Documentation Updated** Updates to documentation
7+
* **Updated Exports:** Revised and improved export structure
8+
* **Database Functions:** Database functions for MongoDB have finally been completed
9+
* **Improved Type Safety:** The type definitions have been updated for improved type safety
10+
* **Package:** Updated package version to 4.0.0
11+
* **Dependencies:** Updated and audited package dependencies
612

713
### [3.5.11](https://github.com/MaximKing1/BLWebhooks/compare/v3.5.10...v3.5.11) (2024-10-22)
814

Diff for: dist/Client.d.ts

+23-8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface WebhooksManager extends EventEmitter {
3535
* const manager = new WebhooksManager(client, PORT, {
3636
* database: "mongoose", // mongoose or sqlite
3737
* protocol: 'discordjs',
38+
* connectionString: 'MongooseURL', // Only Use This If The Database Is Set To Mongoose
3839
* extra: {
3940
* proxyTrust: true, // Use if behind a proxy
4041
* shardedClient: true, // Use if behind a sharded client
@@ -48,6 +49,7 @@ export interface WebhooksManager extends EventEmitter {
4849
* @param client - The Discord.js v14 client instance.
4950
* @param options - Configuration options for the WebhooksManager.
5051
* @param options.database - The database type to use ("mongoose" or "sqlite").
52+
* @param options.connectionString - The connection string for the database.
5153
* @param options.protocol - The protocol to use ("discordjs" or "eris").
5254
* @param options.port - The port for the Express webserver.
5355
* @param options.extra - Additional storage options.
@@ -111,7 +113,7 @@ export declare class WebhooksManager extends EventEmitter {
111113
* await voteManager.setStroage('mongoose', 'MongooseURL');
112114
* ```
113115
*/
114-
setStroage(DB: string, string: string): Promise<void>;
116+
setStroage(DB: string, connectionString: string): Promise<void>;
115117
/**
116118
* @example
117119
* ```js
@@ -147,6 +149,7 @@ export declare class WebhooksManager extends EventEmitter {
147149
* ```
148150
*/
149151
getServer(serverID: string): Promise<any>;
152+
private updateVoteCount;
150153
/**
151154
* @example
152155
* ```js
@@ -166,17 +169,29 @@ export declare class WebhooksManager extends EventEmitter {
166169
* voteClient.IBLVoteHook("IBLHook", "LOADS_OF_RANDOMNESS", true);
167170
* ```
168171
*/
169-
IBLVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
172+
IBLVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
170173
/**
171174
* @deprecated Legacy API
172175
*/
173176
PBLVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
174-
VoidBotsVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
175-
DiscordLabsVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
176-
BListVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
177-
MYBVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
178-
DBCVoteHook(url: any, auth: any, toggle: boolean): Promise<void>;
179-
getVotes(userID: any, option: string): Promise<void>;
177+
VoidBotsVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
178+
DiscordLabsVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
179+
BListVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
180+
MYBVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
181+
DBCVoteHook(url: string, auth: string, toggle: boolean): Promise<void>;
182+
/**
183+
* Get the number of votes for a user
184+
* @param {string} userID - The ID of the user
185+
* @param {string} option - The time period for votes ('total', 'daily', 'weekly', 'monthly')
186+
* @returns {Promise<number>} The number of votes for the specified period
187+
* @throws {Error} If an invalid option is provided or if userID is missing
188+
* @example
189+
* ```js
190+
* const totalVotes = await voteManager.getVotes('123456789', 'total');
191+
* console.log(`Total votes: ${totalVotes}`);
192+
* ```
193+
*/
194+
getVotes(userID: string, option: string): Promise<number>;
180195
/**
181196
* Inits the manager
182197
* @private

0 commit comments

Comments
 (0)