@znan/wabot 0.0.15 → 0.0.18

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/package.json CHANGED
@@ -1,52 +1,52 @@
1
1
  {
2
- "name": "@znan/wabot",
3
- "version": "0.0.15",
4
- "description": "Simple module WhatsApp Bot",
5
- "keywords": [
6
- "wabot",
7
- "bot",
8
- "whatsapp-bot",
9
- "baileys"
10
- ],
11
- "homepage": "https://github.com/znanx/wabot#readme",
12
- "bugs": {
13
- "url": "https://github.com/znanx/wabot/issues"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/znanx/wabot.git"
18
- },
19
- "license": "MIT",
20
- "author": "znan",
21
- "main": "index.js",
22
- "types": "index.d.ts",
23
- "dependencies": {
24
- "@alyachan/api": "^0.0.15",
25
- "@cacheable/node-cache": "^1.5.5",
26
- "@hapi/boom": "^10.0.1",
27
- "async-retry": "^1.3.3",
28
- "awesome-phonenumber": "~2.59.0",
29
- "chalk": "~4.1.2",
30
- "chokidar": "~4.0.3",
31
- "crypto-digest-sync": "^1.0.0",
32
- "css-select": "5.1.0",
33
- "dotenv": "^16.5.0",
34
- "file-type": "~16.5.2",
35
- "fluent-ffmpeg": "~2.1.3",
36
- "form-data": "~4.0.0",
37
- "fs": "^0.0.1-security",
38
- "jimp": "~0.22.12",
39
- "mime-types": "~2.1.32",
40
- "miniget": "~4.2.3",
41
- "moment-timezone": "^0.6.0",
42
- "node-cache": "^5.1.2",
43
- "node-cron": "^4.2.1",
44
- "node-fetch": "2",
45
- "node-id3": "0.2.7",
46
- "node-webpmux": "^3.2.1",
47
- "pino": "^9.7.0",
48
- "qrcode-terminal": "^0.12.0",
49
- "rootpath": "^0.1.2",
50
- "syntax-error": "^1.4.0"
51
- }
2
+ "name": "@znan/wabot",
3
+ "version": "0.0.18",
4
+ "description": "Simple Functions WhatsApp Bot",
5
+ "keywords": [
6
+ "wabot",
7
+ "bot",
8
+ "whatsapp-bot",
9
+ "baileys"
10
+ ],
11
+ "homepage": "https://github.com/znanx/wabot#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/znanx/wabot/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/znanx/wabot.git"
18
+ },
19
+ "license": "MIT",
20
+ "author": "znan",
21
+ "main": "index.js",
22
+ "dependencies": {
23
+ "@alyachan/api": "^0.0.15",
24
+ "@cacheable/node-cache": "^1.5.5",
25
+ "@hapi/boom": "^10.0.1",
26
+ "@znan/helper": "^1.0.6",
27
+ "async-retry": "^1.3.3",
28
+ "awesome-phonenumber": "~2.59.0",
29
+ "chalk": "~4.1.2",
30
+ "chokidar": "~4.0.3",
31
+ "crypto-digest-sync": "^1.0.0",
32
+ "css-select": "5.1.0",
33
+ "dotenv": "^16.5.0",
34
+ "file-type": "~16.5.2",
35
+ "fluent-ffmpeg": "~2.1.3",
36
+ "form-data": "~4.0.0",
37
+ "fs": "^0.0.1-security",
38
+ "jimp": "~0.22.12",
39
+ "mime-types": "~2.1.32",
40
+ "miniget": "~4.2.3",
41
+ "moment-timezone": "^0.6.0",
42
+ "node-cache": "^5.1.2",
43
+ "node-cron": "^4.2.1",
44
+ "node-fetch": "2",
45
+ "node-id3": "0.2.7",
46
+ "node-webpmux": "^3.2.1",
47
+ "pino": "^9.7.0",
48
+ "qrcode-terminal": "^0.12.0",
49
+ "rootpath": "^0.1.2",
50
+ "syntax-error": "^1.4.0"
51
+ }
52
52
  }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- import 'dotenv/config';
@@ -1,53 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- interface ConnectionOptions {
3
- directory?: string;
4
- online?: boolean;
5
- browser?: [string, string, string];
6
- version?: [number, number, number];
7
- session?: string | {
8
- state: any;
9
- saveCreds: () => Promise<void>;
10
- deleteCreds: () => Promise<void>;
11
- autoDeleteOldData: () => Promise<void>;
12
- restoreCreds: () => Promise<void>;
13
- };
14
- code?: string | null;
15
- bypass_ephemeral?: boolean;
16
- bot?: (m: any) => boolean;
17
- }
18
- interface Setting {
19
- multiprefix: boolean;
20
- prefix: string[];
21
- onlyprefix: string;
22
- hidden: string[];
23
- pluginDisable: string[];
24
- }
25
- declare class Connection extends EventEmitter {
26
- private directory;
27
- sock: any | null;
28
- private store;
29
- private online;
30
- private options;
31
- private pluginManager;
32
- private browser;
33
- private version;
34
- private session;
35
- private code;
36
- private bypass_ephemeral;
37
- private bot;
38
- private pairingConfig;
39
- setting: Setting;
40
- private listenerRegistry;
41
- constructor(opts?: ConnectionOptions, options?: {});
42
- registry: (event: string, cb: (...args: any[]) => void, limit?: number, reset?: boolean) => void;
43
- private createListener;
44
- private init;
45
- private getMessage;
46
- private socket;
47
- private clearSession;
48
- private clearSessionAndRestart;
49
- private regEvent;
50
- private preEvent;
51
- private regSetting;
52
- }
53
- export = Connection;
@@ -1,10 +0,0 @@
1
- declare class Message {
2
- tags: {
3
- album: string;
4
- APIC: string;
5
- };
6
- mention: (text: any) => string[];
7
- customId: () => string;
8
- extend: (conn: any, cached: any, store: any, ephemeral: Boolean) => void;
9
- }
10
- export = Message;
@@ -1,10 +0,0 @@
1
- import Message from './Message';
2
- declare class Serialize extends Message {
3
- constructor(...args: ConstructorParameters<typeof Message>);
4
- extractMentions: (text: string) => string[];
5
- _getMessageType: (messageContent: Record<string, any> | undefined) => string | null;
6
- _getBodyText: (message: any) => string;
7
- jidNormalize: (parent: any, jid: any) => any;
8
- bind(conn: any, rawMessage: any, ephemeral: Boolean | undefined, botId: (id?: string) => boolean): any;
9
- }
10
- export = Serialize;
@@ -1,20 +0,0 @@
1
- import { proto } from '@whiskeysockets/baileys';
2
- declare function makeInMemoryStore(): {
3
- messages: Record<string, proto.IWebMessageInfo[]>;
4
- chats: Record<string, any>;
5
- presences: Record<string, any>;
6
- contacts: Record<string, any>;
7
- state: {
8
- connection: "close";
9
- };
10
- getContact: (jid: string) => any;
11
- fetchGroupMetadata: (jid: string, groupMetadata: (jid: string) => Promise<any>) => Promise<any>;
12
- contactsUpsert: (newContacts: any[]) => Set<string>;
13
- findMessageById: (id: string) => proto.IWebMessageInfo | null;
14
- loadMessage: (jid: string, id?: string | null) => proto.IWebMessageInfo | null;
15
- updateMessageWithReaction: any;
16
- updateMessageWithReceipt: any;
17
- writeToFile: (path: string) => void;
18
- readFromFile: (path: string) => void;
19
- };
20
- export { makeInMemoryStore };
@@ -1,32 +0,0 @@
1
- declare class Converter {
2
- /**
3
- *
4
- * @param buffer
5
- * @param args
6
- * @param ext
7
- * @param ext2
8
- * @returns
9
- */
10
- ffmpeg: (buffer: Buffer, args: any[] | undefined, ext: string | null, ext2: string | null) => Promise<unknown>;
11
- /**
12
- *
13
- * @param buffer
14
- * @param ext
15
- * @returns
16
- */
17
- toAudio: (buffer: Buffer, ext: string | null) => Promise<unknown>;
18
- /**
19
- *
20
- * @param buffer
21
- * @param ext
22
- * @returns
23
- */
24
- toPTT: (buffer: Buffer, ext: string | null) => Promise<unknown>;
25
- /**
26
- * Convert Audio to Playable WhatsApp Video
27
- * @param {Buffer} buffer Video Buffer
28
- * @param {String} ext File Extension
29
- */
30
- toVideo: (buffer: Buffer, ext: string | null) => Promise<unknown>;
31
- }
32
- export = Converter;
@@ -1,36 +0,0 @@
1
- declare class Exif {
2
- /**
3
- *
4
- * @param media
5
- * @returns
6
- */
7
- imageToWebp(media: any): Promise<NonSharedBuffer>;
8
- /**
9
- *
10
- * @param media
11
- * @returns
12
- */
13
- videoToWebp(media: any): Promise<NonSharedBuffer>;
14
- /**
15
- *
16
- * @param media
17
- * @param metadata
18
- * @returns
19
- */
20
- writeExifImg(media: any, metadata: any): Promise<string | undefined>;
21
- /**
22
- *
23
- * @param media
24
- * @param metadata
25
- * @returns
26
- */
27
- writeExifWebp(media: any, metadata: any): Promise<string | undefined>;
28
- /**
29
- *
30
- * @param media
31
- * @param metadata
32
- * @returns
33
- */
34
- writeExifVid(media: any, metadata: any): Promise<string | undefined>;
35
- }
36
- export = Exif;
@@ -1,424 +0,0 @@
1
- declare class Function {
2
- /**
3
- *
4
- * @param e
5
- * @returns
6
- */
7
- handleError: (e: unknown) => {
8
- status: false;
9
- msg: string;
10
- };
11
- /**
12
- *
13
- * @param ms
14
- * @returns
15
- */
16
- delay: (ms: number) => Promise<void>;
17
- /**
18
- *
19
- * @param url
20
- * @returns
21
- */
22
- isUrl: (url: string) => boolean;
23
- /**
24
- *
25
- * @param source
26
- * @param width
27
- * @returns
28
- */
29
- createThumb: (source: any, width?: number) => Promise<Buffer<ArrayBufferLike>>;
30
- /**
31
- *
32
- * @param source
33
- * @param factor
34
- * @returns
35
- */
36
- downScale: (source: any, factor?: number) => Promise<Buffer<ArrayBufferLike>>;
37
- /**
38
- *
39
- * @param url
40
- * @param options
41
- * @returns
42
- */
43
- fetchJson: (url: string, options?: object) => Promise<any>;
44
- /**
45
- *
46
- * @param source
47
- * @param options
48
- * @returns
49
- */
50
- fetchBuffer: (source: any, options?: object) => Promise<any>;
51
- /**
52
- *
53
- * @param url
54
- * @returns
55
- */
56
- fetchAsBuffer: (url: string) => Promise<unknown>;
57
- /**
58
- *
59
- * @param url
60
- * @returns
61
- */
62
- fetchAsJSON: (url: string) => Promise<unknown>;
63
- /**
64
- *
65
- * @param url
66
- * @returns
67
- */
68
- fetchAsText: (url: string) => Promise<unknown>;
69
- /**
70
- *
71
- * @param url
72
- * @returns
73
- */
74
- fetchAsBlob: (url: string) => Promise<unknown>;
75
- /**
76
- *
77
- * @param url
78
- * @param headers
79
- * @returns
80
- */
81
- parseCookie: (url: string, headers?: object) => Promise<unknown>;
82
- /**
83
- *
84
- * @param input
85
- * @returns
86
- */
87
- toMp3: (input: any) => Promise<unknown>;
88
- /**
89
- *
90
- * @param fileSource
91
- * @param tags
92
- * @returns
93
- */
94
- metaAudio: (fileSource: any, tags?: any) => Promise<unknown>;
95
- /**
96
- *
97
- * @param style
98
- * @param text
99
- * @returns
100
- */
101
- texted: (style: string, text: string) => string;
102
- /**
103
- *
104
- * @param prefix
105
- * @param command
106
- * @param args
107
- * @returns
108
- */
109
- example: (prefix: string, command: string, args: string) => string;
110
- /**
111
- *
112
- * @param url
113
- * @returns
114
- */
115
- igFixed: (url: string) => any;
116
- /**
117
- *
118
- * @param url
119
- * @returns
120
- */
121
- ttFixed: (url: string) => string;
122
- /**
123
- *
124
- * @param ms
125
- * @returns
126
- */
127
- toTime: (ms: number) => string;
128
- /**
129
- *
130
- * @param ms
131
- * @returns
132
- */
133
- readTime: (ms: number) => {
134
- days: number;
135
- hours: number;
136
- minutes: number;
137
- seconds: number;
138
- };
139
- /**
140
- *
141
- * @param extension
142
- * @returns
143
- */
144
- filename: (extension: string) => string;
145
- /**
146
- *
147
- * @returns
148
- */
149
- uuid: () => string;
150
- /**
151
- *
152
- * @param arr
153
- * @returns
154
- */
155
- random: (arr: any) => any;
156
- /**
157
- *
158
- * @param min
159
- * @param max
160
- * @returns
161
- */
162
- randomInt: (min: number, max: number) => number;
163
- /**
164
- *
165
- * @param numberInput
166
- * @returns
167
- */
168
- formatter: (numberInput: number) => string;
169
- /**
170
- *
171
- * @param number
172
- * @returns
173
- */
174
- formatNumber: (number: number) => string;
175
- /**
176
- *
177
- * @param number
178
- * @returns
179
- */
180
- h2k: (number: number) => string;
181
- /**
182
- *
183
- * @param bytes
184
- * @returns
185
- */
186
- formatSize: (bytes: number) => string;
187
- /**
188
- *
189
- * @param url
190
- * @returns
191
- */
192
- getSize: (url: any) => Promise<string>;
193
- /**
194
- *
195
- * @param source
196
- * @param originalFilename
197
- * @param headers
198
- * @returns
199
- */
200
- getFile: (source: any, originalFilename?: any, headers?: any) => Promise<unknown>;
201
- /**
202
- *
203
- * @param message
204
- * @returns
205
- */
206
- mtype: (message: any) => any;
207
- /**
208
- *
209
- * @param sizeString
210
- * @param limitInMB
211
- * @returns
212
- */
213
- sizeLimit: (sizeString: string, limitInMB: number) => {
214
- oversize: boolean;
215
- };
216
- /**
217
- *
218
- * @param text
219
- * @returns
220
- */
221
- generateLink: (text: string) => RegExpMatchArray | null;
222
- /**
223
- *
224
- * @param func
225
- * @param delay
226
- * @returns
227
- */
228
- debounce: (func: (...args: any[]) => void, delay: number) => (...args: any[]) => void;
229
- /**
230
- *
231
- * @param modulePath
232
- * @param delay
233
- * @returns
234
- */
235
- reload: (modulePath: any, delay?: number) => void;
236
- /**
237
- *
238
- * @param a
239
- */
240
- updateFile: (a: any) => void;
241
- /**
242
- *
243
- * @param obj
244
- * @returns
245
- */
246
- jsonFormat: (obj: object) => any;
247
- /**
248
- *
249
- * @param str
250
- * @returns
251
- */
252
- ucword: (str: string) => string;
253
- /**
254
- *
255
- * @param {*} arr
256
- * @returns
257
- */
258
- arrayJoin: (arr: any[][]) => any[];
259
- /**
260
- *
261
- * @param {*} arr
262
- * @param {*} itemToRemove
263
- * @returns
264
- */
265
- removeItem: (arr: any, itemToRemove: any) => any;
266
- /**
267
- *
268
- * @param url
269
- * @returns
270
- */
271
- socmed: (url: string) => boolean;
272
- /**
273
- *
274
- * @param {*} ms
275
- * @returns
276
- */
277
- toDate: (ms: number) => string;
278
- /**
279
- *
280
- * @param {*} totalSecondsInput
281
- * @returns
282
- */
283
- timeFormat: (totalSecondsInput: any) => string;
284
- /**
285
- *
286
- * @param {*} input
287
- * @param {*} commands
288
- * @param {*} threshold
289
- * @returns
290
- */
291
- matcher: (input: string, commands: any, threshold?: number) => any;
292
- /**
293
- *
294
- * @param {*} a
295
- * @param {*} b
296
- * @returns
297
- */
298
- levenshteinDistance: (a: string, b: string) => number;
299
- /**
300
- *
301
- * @param {*} condition
302
- * @param {*} trueText
303
- * @param {*} falseText
304
- * @returns
305
- */
306
- switcher: (condition: string, trueText: string, falseText: string) => string;
307
- /**
308
- *
309
- * @param {*} length
310
- * @returns
311
- */
312
- makeId: (length: any) => string;
313
- /**
314
- *
315
- * @param {*} milliseconds
316
- * @returns
317
- */
318
- timeReverse: (milliseconds: number) => string;
319
- greeting: () => "Good Night" | "Good Afternoon" | "Good Morning";
320
- /**
321
- *
322
- * @param {*} fileOrUrl
323
- * @returns
324
- */
325
- jsonRandom: (fileOrUrl: string) => Promise<any>;
326
- /**
327
- *
328
- * @param {*} currentXp
329
- * @param {*} xpNeeded
330
- * @returns
331
- */
332
- leveling: (currentXp: number, xpNeeded?: number) => {
333
- currentXp: number;
334
- currentLevel: number;
335
- nextLevel: number;
336
- xpToLevelUp: number;
337
- remainingXp: number;
338
- };
339
- /**
340
- *
341
- * @param {*} B
342
- * @returns
343
- */
344
- filter: (B: string) => string;
345
- /**
346
- *
347
- * @param {*} B
348
- * @param {*} F
349
- * @returns
350
- */
351
- randomString: (B: number, F?: string) => string;
352
- /**
353
- *
354
- * @param {*} text
355
- * @returns
356
- */
357
- removeEmojis: (text: string) => string;
358
- /**
359
- *
360
- * @param {*} buffer
361
- * @param {*} width
362
- * @param {*} height
363
- * @returns
364
- */
365
- reSize: (buffer: any, width: number, height: number) => Promise<Buffer<ArrayBufferLike>>;
366
- /**
367
- *
368
- * @param {*} text
369
- * @returns
370
- */
371
- detectStyledAlphabet: (text: string) => never[] | RegExpMatchArray;
372
- /**
373
- *
374
- * @param {*} cmd
375
- * @param {*} m
376
- * @returns
377
- */
378
- hitstat: (cmd: string) => void;
379
- /**
380
- *
381
- * @param {*} text
382
- * @param {*} style
383
- * @returns
384
- */
385
- Styles: (text: string, style?: number) => string;
386
- /**
387
- *
388
- * @param {*} message
389
- * @param {*} logName
390
- */
391
- logFile: (message: string) => void;
392
- /**
393
- *
394
- * @param {*} B
395
- * @returns
396
- */
397
- getEmoji: (B: string) => RegExpMatchArray | null;
398
- /**
399
- *
400
- * @param {*} B
401
- * @returns
402
- */
403
- isEmojiPrefix: (B: string) => boolean;
404
- /**
405
- *
406
- * @param {*} messageId
407
- * @returns
408
- */
409
- getDevice: (messageId: string) => "Android" | "iOS" | "WhatsApp Web";
410
- /**
411
- *
412
- * @param {*} type
413
- * @param {*} text
414
- * @returns
415
- */
416
- fake: (type: string, text?: string) => any;
417
- /**
418
- *
419
- * @param {*} arr
420
- * @returns
421
- */
422
- removeLid: (arr: any[]) => any[];
423
- }
424
- export = Function;