@znan/wabot 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +1 -1
- package/lib/Database/MongoDB.js +1 -0
- package/lib/Database/PostgreSQL.js +1 -0
- package/lib/Socket/Connection.js +1 -1
- package/lib/Socket/Message.js +1 -1
- package/lib/Socket/Serialize.js +1 -1
- package/lib/Socket/Store.js +1 -1
- package/lib/System/Converter.js +1 -1
- package/lib/System/Exif.js +1 -1
- package/lib/System/Function.js +1 -1
- package/lib/System/Scraper.js +1 -1
- package/lib/Utils/Cached.js +1 -1
- package/lib/Utils/Cooldown.js +1 -1
- package/lib/Utils/GetCommand.js +1 -1
- package/lib/Utils/Logger.js +1 -1
- package/lib/Utils/ParseCommand.js +1 -1
- package/lib/Utils/Plugins.js +1 -1
- package/lib/Utils/Session.js +1 -1
- package/lib/Utils/Spam.js +1 -1
- package/package.json +50 -50
- package/index.d.ts +0 -1
- package/lib/Socket/Connection.d.ts +0 -53
- package/lib/Socket/Message.d.ts +0 -10
- package/lib/Socket/Serialize.d.ts +0 -10
- package/lib/Socket/Store.d.ts +0 -20
- package/lib/System/Converter.d.ts +0 -32
- package/lib/System/Exif.d.ts +0 -36
- package/lib/System/Function.d.ts +0 -424
- package/lib/System/Scraper.d.ts +0 -30
- package/lib/Utils/Cached.d.ts +0 -29
- package/lib/Utils/Cooldown.d.ts +0 -15
- package/lib/Utils/GetCommand.d.ts +0 -8
- package/lib/Utils/Logger.d.ts +0 -8
- package/lib/Utils/ParseCommand.d.ts +0 -4
- package/lib/Utils/Plugins.d.ts +0 -26
- package/lib/Utils/Session.d.ts +0 -10
- package/lib/Utils/Spam.d.ts +0 -32
package/lib/System/Scraper.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
declare class Scraper {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param url
|
|
5
|
-
* @param time
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
shorten: (url: string, time?: number) => Promise<unknown>;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param i
|
|
12
|
-
* @param originalFilePath
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
uploader: (i: Buffer | string, originalFilePath?: null) => Promise<unknown>;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param i
|
|
19
|
-
* @param extension
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
tmpfiles: (i: Buffer | string, extension?: null) => Promise<unknown>;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param i
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
imgbb: (i: Buffer | string) => Promise<unknown>;
|
|
29
|
-
}
|
|
30
|
-
export = Scraper;
|
package/lib/Utils/Cached.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare class Cached {
|
|
2
|
-
static cacheFunction(id: any, meta: () => Promise<any>): void;
|
|
3
|
-
static getCache(m: any): void;
|
|
4
|
-
private cache;
|
|
5
|
-
private cacheTtl;
|
|
6
|
-
private nullCacheTtl;
|
|
7
|
-
constructor(defaultCacheTtl?: number, defaultNullCacheTtl?: number);
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param key
|
|
11
|
-
* @param value
|
|
12
|
-
* @param ttl
|
|
13
|
-
*/
|
|
14
|
-
setCache(key: string, value: any, ttl: number): void;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param key
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
getCache<T = any>(key: string): T | null;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param key
|
|
24
|
-
* @param asyncFunction
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
cacheFunction<T = any>(key: string, asyncFunction: () => Promise<T>): Promise<T | null>;
|
|
28
|
-
}
|
|
29
|
-
export = Cached;
|
package/lib/Utils/Cooldown.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type CooldownOptions = {
|
|
2
|
-
cooldownSeconds?: number;
|
|
3
|
-
};
|
|
4
|
-
declare class Cooldown {
|
|
5
|
-
private cooldownSeconds;
|
|
6
|
-
private timestamps;
|
|
7
|
-
constructor(options: CooldownOptions);
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param userJid
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
check(userJid: string): boolean;
|
|
14
|
-
}
|
|
15
|
-
export = Cooldown;
|
package/lib/Utils/Logger.d.ts
DELETED
package/lib/Utils/Plugins.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
interface PluginModule {
|
|
2
|
-
run: (...args: any[]) => any;
|
|
3
|
-
help?: string[];
|
|
4
|
-
aliases?: string[];
|
|
5
|
-
filePath?: string;
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
interface PluginOptions {
|
|
9
|
-
dir?: string;
|
|
10
|
-
delay?: number;
|
|
11
|
-
}
|
|
12
|
-
declare class Plugin {
|
|
13
|
-
private dir;
|
|
14
|
-
private delay;
|
|
15
|
-
commands: Map<string, PluginModule>;
|
|
16
|
-
files: Map<string, PluginModule>;
|
|
17
|
-
events: PluginModule[];
|
|
18
|
-
private fileMap;
|
|
19
|
-
constructor(options?: PluginOptions);
|
|
20
|
-
private _clearRequireCache;
|
|
21
|
-
private _unregisterPlugin;
|
|
22
|
-
private _loadPluginFromFile;
|
|
23
|
-
private _initialScan;
|
|
24
|
-
watch(): void;
|
|
25
|
-
}
|
|
26
|
-
export = Plugin;
|
package/lib/Utils/Session.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare class Session {
|
|
2
|
-
private session;
|
|
3
|
-
private BACKUP_DIR;
|
|
4
|
-
constructor(sessionPath: string);
|
|
5
|
-
private init;
|
|
6
|
-
backup(conn: any, path: any): Promise<void>;
|
|
7
|
-
restore(conn: any): Promise<void>;
|
|
8
|
-
isBackupExist(conn: any): Promise<boolean>;
|
|
9
|
-
}
|
|
10
|
-
export = Session;
|
package/lib/Utils/Spam.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
interface UserData {
|
|
2
|
-
banned?: boolean;
|
|
3
|
-
ban_temporary?: number;
|
|
4
|
-
ban_times?: number;
|
|
5
|
-
}
|
|
6
|
-
interface Setting {
|
|
7
|
-
antispam: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface Message {
|
|
10
|
-
sender: string;
|
|
11
|
-
chat: string;
|
|
12
|
-
}
|
|
13
|
-
interface Connection {
|
|
14
|
-
reply(chat: string, text: string, quoted: Message): void;
|
|
15
|
-
}
|
|
16
|
-
interface SpamOptions {
|
|
17
|
-
mode?: 'command' | 'msg' | 'all';
|
|
18
|
-
messageLimit?: number;
|
|
19
|
-
timeWindowSeconds?: number;
|
|
20
|
-
banCooldownSeconds?: number;
|
|
21
|
-
maxBanTimes?: number;
|
|
22
|
-
commandCooldownSeconds?: number;
|
|
23
|
-
}
|
|
24
|
-
declare class Spam {
|
|
25
|
-
private config;
|
|
26
|
-
private userMessages;
|
|
27
|
-
private commandCooldown;
|
|
28
|
-
constructor(options: SpamOptions);
|
|
29
|
-
check(conn: Connection, m: Message, users: UserData, isCommand?: boolean, command?: string, setting?: Setting): boolean;
|
|
30
|
-
private detectSpam;
|
|
31
|
-
}
|
|
32
|
-
export = Spam;
|