@arcaelas/whatsapp 1.4.0 → 2.1.0
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/build/cjs/Chat.d.ts +199 -217
- package/build/cjs/Chat.js +151 -274
- package/build/cjs/Chat.js.map +1 -1
- package/build/cjs/Contact.d.ts +455 -148
- package/build/cjs/Contact.js +74 -103
- package/build/cjs/Contact.js.map +1 -1
- package/build/cjs/Message.d.ts +587 -265
- package/build/cjs/Message.js +304 -254
- package/build/cjs/Message.js.map +1 -1
- package/build/cjs/WhatsApp.d.ts +19 -7
- package/build/cjs/WhatsApp.js +88 -80
- package/build/cjs/WhatsApp.js.map +1 -1
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/store/driver/FileEngine.d.ts +13 -2
- package/build/cjs/store/driver/FileEngine.js +15 -19
- package/build/cjs/store/driver/FileEngine.js.map +1 -1
- package/build/cjs/store/driver/RedisEngine.d.ts +13 -4
- package/build/cjs/store/driver/RedisEngine.js +23 -22
- package/build/cjs/store/driver/RedisEngine.js.map +1 -1
- package/build/cjs/store/engine.d.ts +9 -10
- package/build/esm/Chat.d.ts +199 -217
- package/build/esm/Chat.js +151 -273
- package/build/esm/Chat.js.map +1 -1
- package/build/esm/Contact.d.ts +455 -148
- package/build/esm/Contact.js +74 -102
- package/build/esm/Contact.js.map +1 -1
- package/build/esm/Message.d.ts +587 -265
- package/build/esm/Message.js +305 -254
- package/build/esm/Message.js.map +1 -1
- package/build/esm/WhatsApp.d.ts +19 -7
- package/build/esm/WhatsApp.js +91 -83
- package/build/esm/WhatsApp.js.map +1 -1
- package/build/esm/index.d.ts +2 -2
- package/build/esm/store/driver/FileEngine.d.ts +13 -2
- package/build/esm/store/driver/FileEngine.js +15 -19
- package/build/esm/store/driver/FileEngine.js.map +1 -1
- package/build/esm/store/driver/RedisEngine.d.ts +13 -4
- package/build/esm/store/driver/RedisEngine.js +23 -22
- package/build/esm/store/driver/RedisEngine.js.map +1 -1
- package/build/esm/store/engine.d.ts +9 -10
- package/package.json +2 -2
package/build/cjs/Contact.d.ts
CHANGED
|
@@ -5,90 +5,85 @@
|
|
|
5
5
|
import type { WhatsApp } from './WhatsApp';
|
|
6
6
|
/**
|
|
7
7
|
* @description Objeto raw del contacto (protocolo).
|
|
8
|
+
* Raw contact object (protocol).
|
|
8
9
|
*/
|
|
9
10
|
export interface IContactRaw {
|
|
10
|
-
/** JID único del contacto */
|
|
11
|
+
/** JID único del contacto / Unique contact JID */
|
|
11
12
|
id: string;
|
|
12
|
-
/** ID alternativo en formato LID */
|
|
13
|
+
/** ID alternativo en formato LID / Alternative ID in LID format */
|
|
13
14
|
lid?: string | null;
|
|
14
|
-
/** Nombre guardado en la agenda del usuario */
|
|
15
|
+
/** Nombre guardado en la agenda del usuario / Name saved in user's address book */
|
|
15
16
|
name?: string | null;
|
|
16
|
-
/** Nombre que el contacto configuró en su perfil (pushName) */
|
|
17
|
+
/** Nombre que el contacto configuró en su perfil (pushName) / Profile push name */
|
|
17
18
|
notify?: string | null;
|
|
18
|
-
/** Nombre de cuenta business verificada */
|
|
19
|
+
/** Nombre de cuenta business verificada / Verified business account name */
|
|
19
20
|
verifiedName?: string | null;
|
|
20
|
-
/** URL de la foto de perfil */
|
|
21
|
+
/** URL de la foto de perfil / Profile picture URL */
|
|
21
22
|
imgUrl?: string | null;
|
|
22
|
-
/** Bio/estado del perfil del contacto */
|
|
23
|
+
/** Bio/estado del perfil del contacto / Contact profile bio/status */
|
|
23
24
|
status?: string | null;
|
|
24
25
|
}
|
|
25
|
-
/**
|
|
26
|
-
* @description Datos persistidos de un contacto.
|
|
27
|
-
*/
|
|
28
|
-
export interface IContact {
|
|
29
|
-
/** JID del contacto (ej: 123456@s.whatsapp.net) */
|
|
30
|
-
id: string;
|
|
31
|
-
/** Nombre del contacto */
|
|
32
|
-
name: string;
|
|
33
|
-
/** URL de la foto de perfil o null */
|
|
34
|
-
photo: string | null;
|
|
35
|
-
/** Número de teléfono sin formato */
|
|
36
|
-
phone: string;
|
|
37
|
-
/** Bio del contacto */
|
|
38
|
-
content: string;
|
|
39
|
-
/** Objeto raw del protocolo */
|
|
40
|
-
raw: IContactRaw;
|
|
41
|
-
}
|
|
42
26
|
/**
|
|
43
27
|
* @description
|
|
44
28
|
* Clase base para representar un contacto de WhatsApp.
|
|
45
|
-
*
|
|
29
|
+
* Base class representing a WhatsApp contact.
|
|
46
30
|
*/
|
|
47
31
|
export declare class Contact {
|
|
48
32
|
readonly raw: IContactRaw;
|
|
49
|
-
constructor(
|
|
50
|
-
/** JID único del contacto */
|
|
33
|
+
constructor(raw: IContactRaw);
|
|
34
|
+
/** JID único del contacto / Unique contact JID */
|
|
51
35
|
get id(): string;
|
|
52
|
-
/** Nombre del contacto */
|
|
36
|
+
/** Nombre del contacto / Contact name */
|
|
53
37
|
get name(): string;
|
|
54
|
-
/** URL de la foto de perfil o null */
|
|
38
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
55
39
|
get photo(): string | null;
|
|
56
|
-
/** Número de teléfono sin formato */
|
|
40
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
57
41
|
get phone(): string;
|
|
58
|
-
/** Bio del contacto */
|
|
42
|
+
/** Bio del contacto / Contact bio */
|
|
59
43
|
get content(): string;
|
|
60
44
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @description Construye IContact desde raw.
|
|
63
|
-
* @param raw Objeto raw del contacto.
|
|
64
|
-
* @returns IContact normalizado.
|
|
65
|
-
*/
|
|
66
|
-
export declare function build_contact(raw: IContactRaw): IContact;
|
|
67
45
|
/**
|
|
68
46
|
* @description Factory que retorna la clase Contact enlazada al contexto.
|
|
47
|
+
* Factory that returns the Contact class bound to context.
|
|
69
48
|
* @param wa Instancia de WhatsApp.
|
|
70
|
-
* @returns Clase _Contact que extiende Contact.
|
|
71
49
|
*/
|
|
72
50
|
export declare function contact(wa: WhatsApp): {
|
|
73
|
-
new (
|
|
51
|
+
new (raw: IContactRaw): {
|
|
74
52
|
/**
|
|
75
53
|
* @description Cambia el nombre del contacto.
|
|
54
|
+
* Renames the contact.
|
|
76
55
|
* @param name Nuevo nombre.
|
|
77
|
-
* @returns true si se guardó correctamente.
|
|
78
56
|
*/
|
|
79
57
|
rename(name: string): Promise<boolean>;
|
|
80
58
|
/**
|
|
81
59
|
* @description Actualiza los datos del perfil desde WhatsApp.
|
|
82
|
-
*
|
|
60
|
+
* Refreshes profile data from WhatsApp.
|
|
83
61
|
*/
|
|
84
62
|
refresh(): Promise</*elided*/ any | null>;
|
|
85
63
|
/**
|
|
86
64
|
* @description Obtiene o crea el chat con este contacto.
|
|
87
|
-
*
|
|
65
|
+
* Gets or creates the chat with this contact.
|
|
88
66
|
*/
|
|
89
67
|
chat(): Promise<{
|
|
68
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
69
|
+
remove(): Promise<boolean>;
|
|
70
|
+
pin(value: boolean): Promise<boolean>;
|
|
71
|
+
archive(value: boolean): Promise<boolean>;
|
|
72
|
+
mute(duration: number | null): Promise<boolean>;
|
|
73
|
+
seen(): Promise<boolean>;
|
|
74
|
+
members(offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
90
75
|
messages(offset?: number, limit?: number): Promise<InstanceType<{
|
|
91
76
|
new (data: import("./Message").IMessage): {
|
|
77
|
+
edit(text: string): Promise<boolean>;
|
|
78
|
+
remove(): Promise<boolean>;
|
|
79
|
+
forward(to_cid: string): Promise<boolean>;
|
|
80
|
+
react(emoji: string): Promise<boolean>;
|
|
81
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
82
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
83
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
84
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
85
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
86
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
92
87
|
stream(): Promise<import("node:stream").Readable>;
|
|
93
88
|
content(): Promise<Buffer>;
|
|
94
89
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -109,11 +104,19 @@ export declare function contact(wa: WhatsApp): {
|
|
|
109
104
|
get deleted_at(): number | null;
|
|
110
105
|
};
|
|
111
106
|
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
108
|
+
count(cid: string): Promise<number>;
|
|
109
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
110
|
+
edit(text: string): Promise<boolean>;
|
|
111
|
+
remove(): Promise<boolean>;
|
|
112
|
+
forward(to_cid: string): Promise<boolean>;
|
|
113
|
+
react(emoji: string): Promise<boolean>;
|
|
114
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
115
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
116
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
117
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
118
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
119
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
117
120
|
stream(): Promise<import("node:stream").Readable>;
|
|
118
121
|
content(): Promise<Buffer>;
|
|
119
122
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -133,7 +136,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
133
136
|
get created_at(): number;
|
|
134
137
|
get deleted_at(): number | null;
|
|
135
138
|
} | null>;
|
|
136
|
-
image(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
139
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
140
|
+
edit(text: string): Promise<boolean>;
|
|
141
|
+
remove(): Promise<boolean>;
|
|
142
|
+
forward(to_cid: string): Promise<boolean>;
|
|
143
|
+
react(emoji: string): Promise<boolean>;
|
|
144
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
145
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
146
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
147
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
148
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
149
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
137
150
|
stream(): Promise<import("node:stream").Readable>;
|
|
138
151
|
content(): Promise<Buffer>;
|
|
139
152
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -153,7 +166,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
153
166
|
get created_at(): number;
|
|
154
167
|
get deleted_at(): number | null;
|
|
155
168
|
} | null>;
|
|
156
|
-
video(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
169
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
170
|
+
edit(text: string): Promise<boolean>;
|
|
171
|
+
remove(): Promise<boolean>;
|
|
172
|
+
forward(to_cid: string): Promise<boolean>;
|
|
173
|
+
react(emoji: string): Promise<boolean>;
|
|
174
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
175
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
176
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
177
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
178
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
179
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
157
180
|
stream(): Promise<import("node:stream").Readable>;
|
|
158
181
|
content(): Promise<Buffer>;
|
|
159
182
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -173,7 +196,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
173
196
|
get created_at(): number;
|
|
174
197
|
get deleted_at(): number | null;
|
|
175
198
|
} | null>;
|
|
176
|
-
audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
|
|
199
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
200
|
+
edit(text: string): Promise<boolean>;
|
|
201
|
+
remove(): Promise<boolean>;
|
|
202
|
+
forward(to_cid: string): Promise<boolean>;
|
|
203
|
+
react(emoji: string): Promise<boolean>;
|
|
204
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
205
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
206
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
207
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
208
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
209
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
177
210
|
stream(): Promise<import("node:stream").Readable>;
|
|
178
211
|
content(): Promise<Buffer>;
|
|
179
212
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -193,7 +226,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
193
226
|
get created_at(): number;
|
|
194
227
|
get deleted_at(): number | null;
|
|
195
228
|
} | null>;
|
|
196
|
-
location(cid: string, opts: import("./Message").LocationOptions): Promise<{
|
|
229
|
+
location(cid: string, opts: import("./Message").LocationOptions, mid?: string): Promise<{
|
|
230
|
+
edit(text: string): Promise<boolean>;
|
|
231
|
+
remove(): Promise<boolean>;
|
|
232
|
+
forward(to_cid: string): Promise<boolean>;
|
|
233
|
+
react(emoji: string): Promise<boolean>;
|
|
234
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
235
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
236
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
237
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
238
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
239
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
197
240
|
stream(): Promise<import("node:stream").Readable>;
|
|
198
241
|
content(): Promise<Buffer>;
|
|
199
242
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -213,7 +256,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
213
256
|
get created_at(): number;
|
|
214
257
|
get deleted_at(): number | null;
|
|
215
258
|
} | null>;
|
|
216
|
-
poll(cid: string, opts: import("./Message").PollOptions): Promise<{
|
|
259
|
+
poll(cid: string, opts: import("./Message").PollOptions, mid?: string): Promise<{
|
|
260
|
+
edit(text: string): Promise<boolean>;
|
|
261
|
+
remove(): Promise<boolean>;
|
|
262
|
+
forward(to_cid: string): Promise<boolean>;
|
|
263
|
+
react(emoji: string): Promise<boolean>;
|
|
264
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
265
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
266
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
267
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
268
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
269
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
217
270
|
stream(): Promise<import("node:stream").Readable>;
|
|
218
271
|
content(): Promise<Buffer>;
|
|
219
272
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -233,57 +286,82 @@ export declare function contact(wa: WhatsApp): {
|
|
|
233
286
|
get created_at(): number;
|
|
234
287
|
get deleted_at(): number | null;
|
|
235
288
|
} | null>;
|
|
289
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
290
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
291
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
292
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
236
293
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
237
|
-
|
|
294
|
+
} & {
|
|
295
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
296
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
297
|
+
_notify: (cid: string, mid: string) => void;
|
|
298
|
+
_build_index: (raw: import("baileys").WAMessage, edited?: boolean) => import("./Message").IMessageIndex;
|
|
238
299
|
}>[]>;
|
|
239
|
-
|
|
300
|
+
contact(): Promise<InstanceType</*elided*/ any> | null>;
|
|
240
301
|
readonly raw: import("./Chat").IChatRaw;
|
|
241
302
|
get id(): string;
|
|
242
303
|
get type(): "contact" | "group";
|
|
243
304
|
get name(): string;
|
|
244
305
|
get content(): string;
|
|
245
|
-
get
|
|
306
|
+
get pinned(): boolean;
|
|
246
307
|
get archived(): boolean;
|
|
247
|
-
get muted(): number
|
|
248
|
-
get
|
|
308
|
+
get muted(): number;
|
|
309
|
+
get read(): boolean;
|
|
249
310
|
get readonly(): boolean;
|
|
250
311
|
} | null>;
|
|
251
312
|
readonly raw: IContactRaw;
|
|
252
|
-
/** JID único del contacto */
|
|
313
|
+
/** JID único del contacto / Unique contact JID */
|
|
253
314
|
get id(): string;
|
|
254
|
-
/** Nombre del contacto */
|
|
315
|
+
/** Nombre del contacto / Contact name */
|
|
255
316
|
get name(): string;
|
|
256
|
-
/** URL de la foto de perfil o null */
|
|
317
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
257
318
|
get photo(): string | null;
|
|
258
|
-
/** Número de teléfono sin formato */
|
|
319
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
259
320
|
get phone(): string;
|
|
260
|
-
/** Bio del contacto */
|
|
321
|
+
/** Bio del contacto / Contact bio */
|
|
261
322
|
get content(): string;
|
|
262
323
|
};
|
|
263
324
|
/**
|
|
264
325
|
* @description Obtiene un contacto por su ID.
|
|
265
|
-
*
|
|
266
|
-
* @
|
|
326
|
+
* Retrieves a contact by its ID.
|
|
327
|
+
* @param uid JID del contacto o número de teléfono.
|
|
267
328
|
*/
|
|
268
329
|
get(uid: string): Promise<{
|
|
269
330
|
/**
|
|
270
331
|
* @description Cambia el nombre del contacto.
|
|
332
|
+
* Renames the contact.
|
|
271
333
|
* @param name Nuevo nombre.
|
|
272
|
-
* @returns true si se guardó correctamente.
|
|
273
334
|
*/
|
|
274
335
|
rename(name: string): Promise<boolean>;
|
|
275
336
|
/**
|
|
276
337
|
* @description Actualiza los datos del perfil desde WhatsApp.
|
|
277
|
-
*
|
|
338
|
+
* Refreshes profile data from WhatsApp.
|
|
278
339
|
*/
|
|
279
340
|
refresh(): Promise</*elided*/ any | null>;
|
|
280
341
|
/**
|
|
281
342
|
* @description Obtiene o crea el chat con este contacto.
|
|
282
|
-
*
|
|
343
|
+
* Gets or creates the chat with this contact.
|
|
283
344
|
*/
|
|
284
345
|
chat(): Promise<{
|
|
346
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
347
|
+
remove(): Promise<boolean>;
|
|
348
|
+
pin(value: boolean): Promise<boolean>;
|
|
349
|
+
archive(value: boolean): Promise<boolean>;
|
|
350
|
+
mute(duration: number | null): Promise<boolean>;
|
|
351
|
+
seen(): Promise<boolean>;
|
|
352
|
+
members(offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
285
353
|
messages(offset?: number, limit?: number): Promise<InstanceType<{
|
|
286
354
|
new (data: import("./Message").IMessage): {
|
|
355
|
+
edit(text: string): Promise<boolean>;
|
|
356
|
+
remove(): Promise<boolean>;
|
|
357
|
+
forward(to_cid: string): Promise<boolean>;
|
|
358
|
+
react(emoji: string): Promise<boolean>;
|
|
359
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
360
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
361
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
362
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
363
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
364
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
287
365
|
stream(): Promise<import("node:stream").Readable>;
|
|
288
366
|
content(): Promise<Buffer>;
|
|
289
367
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -304,11 +382,19 @@ export declare function contact(wa: WhatsApp): {
|
|
|
304
382
|
get deleted_at(): number | null;
|
|
305
383
|
};
|
|
306
384
|
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
385
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
386
|
+
count(cid: string): Promise<number>;
|
|
387
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
388
|
+
edit(text: string): Promise<boolean>;
|
|
389
|
+
remove(): Promise<boolean>;
|
|
390
|
+
forward(to_cid: string): Promise<boolean>;
|
|
391
|
+
react(emoji: string): Promise<boolean>;
|
|
392
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
393
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
394
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
395
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
396
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
397
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
312
398
|
stream(): Promise<import("node:stream").Readable>;
|
|
313
399
|
content(): Promise<Buffer>;
|
|
314
400
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -328,7 +414,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
328
414
|
get created_at(): number;
|
|
329
415
|
get deleted_at(): number | null;
|
|
330
416
|
} | null>;
|
|
331
|
-
image(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
417
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
418
|
+
edit(text: string): Promise<boolean>;
|
|
419
|
+
remove(): Promise<boolean>;
|
|
420
|
+
forward(to_cid: string): Promise<boolean>;
|
|
421
|
+
react(emoji: string): Promise<boolean>;
|
|
422
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
423
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
424
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
425
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
426
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
427
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
332
428
|
stream(): Promise<import("node:stream").Readable>;
|
|
333
429
|
content(): Promise<Buffer>;
|
|
334
430
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -348,7 +444,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
348
444
|
get created_at(): number;
|
|
349
445
|
get deleted_at(): number | null;
|
|
350
446
|
} | null>;
|
|
351
|
-
video(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
447
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
448
|
+
edit(text: string): Promise<boolean>;
|
|
449
|
+
remove(): Promise<boolean>;
|
|
450
|
+
forward(to_cid: string): Promise<boolean>;
|
|
451
|
+
react(emoji: string): Promise<boolean>;
|
|
452
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
453
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
454
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
455
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
456
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
457
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
352
458
|
stream(): Promise<import("node:stream").Readable>;
|
|
353
459
|
content(): Promise<Buffer>;
|
|
354
460
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -368,7 +474,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
368
474
|
get created_at(): number;
|
|
369
475
|
get deleted_at(): number | null;
|
|
370
476
|
} | null>;
|
|
371
|
-
audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
|
|
477
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
478
|
+
edit(text: string): Promise<boolean>;
|
|
479
|
+
remove(): Promise<boolean>;
|
|
480
|
+
forward(to_cid: string): Promise<boolean>;
|
|
481
|
+
react(emoji: string): Promise<boolean>;
|
|
482
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
483
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
484
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
485
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
486
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
487
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
372
488
|
stream(): Promise<import("node:stream").Readable>;
|
|
373
489
|
content(): Promise<Buffer>;
|
|
374
490
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -388,7 +504,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
388
504
|
get created_at(): number;
|
|
389
505
|
get deleted_at(): number | null;
|
|
390
506
|
} | null>;
|
|
391
|
-
location(cid: string, opts: import("./Message").LocationOptions): Promise<{
|
|
507
|
+
location(cid: string, opts: import("./Message").LocationOptions, mid?: string): Promise<{
|
|
508
|
+
edit(text: string): Promise<boolean>;
|
|
509
|
+
remove(): Promise<boolean>;
|
|
510
|
+
forward(to_cid: string): Promise<boolean>;
|
|
511
|
+
react(emoji: string): Promise<boolean>;
|
|
512
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
513
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
514
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
515
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
516
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
517
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
392
518
|
stream(): Promise<import("node:stream").Readable>;
|
|
393
519
|
content(): Promise<Buffer>;
|
|
394
520
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -408,7 +534,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
408
534
|
get created_at(): number;
|
|
409
535
|
get deleted_at(): number | null;
|
|
410
536
|
} | null>;
|
|
411
|
-
poll(cid: string, opts: import("./Message").PollOptions): Promise<{
|
|
537
|
+
poll(cid: string, opts: import("./Message").PollOptions, mid?: string): Promise<{
|
|
538
|
+
edit(text: string): Promise<boolean>;
|
|
539
|
+
remove(): Promise<boolean>;
|
|
540
|
+
forward(to_cid: string): Promise<boolean>;
|
|
541
|
+
react(emoji: string): Promise<boolean>;
|
|
542
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
543
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
544
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
545
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
546
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
547
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
412
548
|
stream(): Promise<import("node:stream").Readable>;
|
|
413
549
|
content(): Promise<Buffer>;
|
|
414
550
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -428,57 +564,83 @@ export declare function contact(wa: WhatsApp): {
|
|
|
428
564
|
get created_at(): number;
|
|
429
565
|
get deleted_at(): number | null;
|
|
430
566
|
} | null>;
|
|
567
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
568
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
569
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
570
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
431
571
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
432
|
-
|
|
572
|
+
} & {
|
|
573
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
574
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
575
|
+
_notify: (cid: string, mid: string) => void;
|
|
576
|
+
_build_index: (raw: import("baileys").WAMessage, edited?: boolean) => import("./Message").IMessageIndex;
|
|
433
577
|
}>[]>;
|
|
434
|
-
|
|
578
|
+
contact(): Promise<InstanceType</*elided*/ any> | null>;
|
|
435
579
|
readonly raw: import("./Chat").IChatRaw;
|
|
436
580
|
get id(): string;
|
|
437
581
|
get type(): "contact" | "group";
|
|
438
582
|
get name(): string;
|
|
439
583
|
get content(): string;
|
|
440
|
-
get
|
|
584
|
+
get pinned(): boolean;
|
|
441
585
|
get archived(): boolean;
|
|
442
|
-
get muted(): number
|
|
443
|
-
get
|
|
586
|
+
get muted(): number;
|
|
587
|
+
get read(): boolean;
|
|
444
588
|
get readonly(): boolean;
|
|
445
589
|
} | null>;
|
|
446
590
|
readonly raw: IContactRaw;
|
|
447
|
-
/** JID único del contacto */
|
|
591
|
+
/** JID único del contacto / Unique contact JID */
|
|
448
592
|
get id(): string;
|
|
449
|
-
/** Nombre del contacto */
|
|
593
|
+
/** Nombre del contacto / Contact name */
|
|
450
594
|
get name(): string;
|
|
451
|
-
/** URL de la foto de perfil o null */
|
|
595
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
452
596
|
get photo(): string | null;
|
|
453
|
-
/** Número de teléfono sin formato */
|
|
597
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
454
598
|
get phone(): string;
|
|
455
|
-
/** Bio del contacto */
|
|
599
|
+
/** Bio del contacto / Contact bio */
|
|
456
600
|
get content(): string;
|
|
457
601
|
} | null>;
|
|
458
602
|
/**
|
|
459
|
-
* @description
|
|
460
|
-
*
|
|
461
|
-
* @
|
|
603
|
+
* @description Obtiene contactos paginados.
|
|
604
|
+
* Retrieves paginated contacts.
|
|
605
|
+
* @param offset Inicio de paginación.
|
|
606
|
+
* @param limit Cantidad máxima de resultados.
|
|
462
607
|
*/
|
|
463
|
-
|
|
608
|
+
list(offset?: number, limit?: number): Promise<{
|
|
464
609
|
/**
|
|
465
610
|
* @description Cambia el nombre del contacto.
|
|
611
|
+
* Renames the contact.
|
|
466
612
|
* @param name Nuevo nombre.
|
|
467
|
-
* @returns true si se guardó correctamente.
|
|
468
613
|
*/
|
|
469
614
|
rename(name: string): Promise<boolean>;
|
|
470
615
|
/**
|
|
471
616
|
* @description Actualiza los datos del perfil desde WhatsApp.
|
|
472
|
-
*
|
|
617
|
+
* Refreshes profile data from WhatsApp.
|
|
473
618
|
*/
|
|
474
619
|
refresh(): Promise</*elided*/ any | null>;
|
|
475
620
|
/**
|
|
476
621
|
* @description Obtiene o crea el chat con este contacto.
|
|
477
|
-
*
|
|
622
|
+
* Gets or creates the chat with this contact.
|
|
478
623
|
*/
|
|
479
624
|
chat(): Promise<{
|
|
625
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
626
|
+
remove(): Promise<boolean>;
|
|
627
|
+
pin(value: boolean): Promise<boolean>;
|
|
628
|
+
archive(value: boolean): Promise<boolean>;
|
|
629
|
+
mute(duration: number | null): Promise<boolean>;
|
|
630
|
+
seen(): Promise<boolean>;
|
|
631
|
+
members(offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
480
632
|
messages(offset?: number, limit?: number): Promise<InstanceType<{
|
|
481
633
|
new (data: import("./Message").IMessage): {
|
|
634
|
+
edit(text: string): Promise<boolean>;
|
|
635
|
+
remove(): Promise<boolean>;
|
|
636
|
+
forward(to_cid: string): Promise<boolean>;
|
|
637
|
+
react(emoji: string): Promise<boolean>;
|
|
638
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
639
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
640
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
641
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
642
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
643
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
482
644
|
stream(): Promise<import("node:stream").Readable>;
|
|
483
645
|
content(): Promise<Buffer>;
|
|
484
646
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -499,11 +661,19 @@ export declare function contact(wa: WhatsApp): {
|
|
|
499
661
|
get deleted_at(): number | null;
|
|
500
662
|
};
|
|
501
663
|
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
664
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
665
|
+
count(cid: string): Promise<number>;
|
|
666
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
667
|
+
edit(text: string): Promise<boolean>;
|
|
668
|
+
remove(): Promise<boolean>;
|
|
669
|
+
forward(to_cid: string): Promise<boolean>;
|
|
670
|
+
react(emoji: string): Promise<boolean>;
|
|
671
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
672
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
673
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
674
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
675
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
676
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
507
677
|
stream(): Promise<import("node:stream").Readable>;
|
|
508
678
|
content(): Promise<Buffer>;
|
|
509
679
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -523,7 +693,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
523
693
|
get created_at(): number;
|
|
524
694
|
get deleted_at(): number | null;
|
|
525
695
|
} | null>;
|
|
526
|
-
image(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
696
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
697
|
+
edit(text: string): Promise<boolean>;
|
|
698
|
+
remove(): Promise<boolean>;
|
|
699
|
+
forward(to_cid: string): Promise<boolean>;
|
|
700
|
+
react(emoji: string): Promise<boolean>;
|
|
701
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
702
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
703
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
704
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
705
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
706
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
527
707
|
stream(): Promise<import("node:stream").Readable>;
|
|
528
708
|
content(): Promise<Buffer>;
|
|
529
709
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -543,7 +723,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
543
723
|
get created_at(): number;
|
|
544
724
|
get deleted_at(): number | null;
|
|
545
725
|
} | null>;
|
|
546
|
-
video(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
726
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
727
|
+
edit(text: string): Promise<boolean>;
|
|
728
|
+
remove(): Promise<boolean>;
|
|
729
|
+
forward(to_cid: string): Promise<boolean>;
|
|
730
|
+
react(emoji: string): Promise<boolean>;
|
|
731
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
732
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
733
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
734
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
735
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
736
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
547
737
|
stream(): Promise<import("node:stream").Readable>;
|
|
548
738
|
content(): Promise<Buffer>;
|
|
549
739
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -563,7 +753,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
563
753
|
get created_at(): number;
|
|
564
754
|
get deleted_at(): number | null;
|
|
565
755
|
} | null>;
|
|
566
|
-
audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
|
|
756
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
757
|
+
edit(text: string): Promise<boolean>;
|
|
758
|
+
remove(): Promise<boolean>;
|
|
759
|
+
forward(to_cid: string): Promise<boolean>;
|
|
760
|
+
react(emoji: string): Promise<boolean>;
|
|
761
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
762
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
763
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
764
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
765
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
766
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
567
767
|
stream(): Promise<import("node:stream").Readable>;
|
|
568
768
|
content(): Promise<Buffer>;
|
|
569
769
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -583,7 +783,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
583
783
|
get created_at(): number;
|
|
584
784
|
get deleted_at(): number | null;
|
|
585
785
|
} | null>;
|
|
586
|
-
location(cid: string, opts: import("./Message").LocationOptions): Promise<{
|
|
786
|
+
location(cid: string, opts: import("./Message").LocationOptions, mid?: string): Promise<{
|
|
787
|
+
edit(text: string): Promise<boolean>;
|
|
788
|
+
remove(): Promise<boolean>;
|
|
789
|
+
forward(to_cid: string): Promise<boolean>;
|
|
790
|
+
react(emoji: string): Promise<boolean>;
|
|
791
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
792
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
793
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
794
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
795
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
796
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
587
797
|
stream(): Promise<import("node:stream").Readable>;
|
|
588
798
|
content(): Promise<Buffer>;
|
|
589
799
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -603,7 +813,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
603
813
|
get created_at(): number;
|
|
604
814
|
get deleted_at(): number | null;
|
|
605
815
|
} | null>;
|
|
606
|
-
poll(cid: string, opts: import("./Message").PollOptions): Promise<{
|
|
816
|
+
poll(cid: string, opts: import("./Message").PollOptions, mid?: string): Promise<{
|
|
817
|
+
edit(text: string): Promise<boolean>;
|
|
818
|
+
remove(): Promise<boolean>;
|
|
819
|
+
forward(to_cid: string): Promise<boolean>;
|
|
820
|
+
react(emoji: string): Promise<boolean>;
|
|
821
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
822
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
823
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
824
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
825
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
826
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
607
827
|
stream(): Promise<import("node:stream").Readable>;
|
|
608
828
|
content(): Promise<Buffer>;
|
|
609
829
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -623,65 +843,86 @@ export declare function contact(wa: WhatsApp): {
|
|
|
623
843
|
get created_at(): number;
|
|
624
844
|
get deleted_at(): number | null;
|
|
625
845
|
} | null>;
|
|
846
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
847
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
848
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
849
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
626
850
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
627
|
-
|
|
851
|
+
} & {
|
|
852
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
853
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
854
|
+
_notify: (cid: string, mid: string) => void;
|
|
855
|
+
_build_index: (raw: import("baileys").WAMessage, edited?: boolean) => import("./Message").IMessageIndex;
|
|
628
856
|
}>[]>;
|
|
629
|
-
|
|
857
|
+
contact(): Promise<InstanceType</*elided*/ any> | null>;
|
|
630
858
|
readonly raw: import("./Chat").IChatRaw;
|
|
631
859
|
get id(): string;
|
|
632
860
|
get type(): "contact" | "group";
|
|
633
861
|
get name(): string;
|
|
634
862
|
get content(): string;
|
|
635
|
-
get
|
|
863
|
+
get pinned(): boolean;
|
|
636
864
|
get archived(): boolean;
|
|
637
|
-
get muted(): number
|
|
638
|
-
get
|
|
865
|
+
get muted(): number;
|
|
866
|
+
get read(): boolean;
|
|
639
867
|
get readonly(): boolean;
|
|
640
868
|
} | null>;
|
|
641
869
|
readonly raw: IContactRaw;
|
|
642
|
-
/** JID único del contacto */
|
|
870
|
+
/** JID único del contacto / Unique contact JID */
|
|
643
871
|
get id(): string;
|
|
644
|
-
/** Nombre del contacto */
|
|
872
|
+
/** Nombre del contacto / Contact name */
|
|
645
873
|
get name(): string;
|
|
646
|
-
/** URL de la foto de perfil o null */
|
|
874
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
647
875
|
get photo(): string | null;
|
|
648
|
-
/** Número de teléfono sin formato */
|
|
876
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
649
877
|
get phone(): string;
|
|
650
|
-
/** Bio del contacto */
|
|
878
|
+
/** Bio del contacto / Contact bio */
|
|
651
879
|
get content(): string;
|
|
652
|
-
}
|
|
880
|
+
}[]>;
|
|
653
881
|
/**
|
|
654
|
-
* @description Cambia el nombre de un contacto.
|
|
655
|
-
*
|
|
656
|
-
* @param name Nuevo nombre.
|
|
657
|
-
* @returns true si se guardó correctamente.
|
|
882
|
+
* @description Cambia el nombre de un contacto por su ID.
|
|
883
|
+
* Renames a contact by its ID.
|
|
658
884
|
*/
|
|
659
885
|
rename(uid: string, name: string): Promise<boolean>;
|
|
660
886
|
/**
|
|
661
|
-
* @description
|
|
662
|
-
*
|
|
663
|
-
* @param limit Cantidad máxima de resultados.
|
|
664
|
-
* @returns Array de contactos.
|
|
887
|
+
* @description Actualiza los datos de un contacto desde WhatsApp por su ID.
|
|
888
|
+
* Refreshes a contact's data from WhatsApp by its ID.
|
|
665
889
|
*/
|
|
666
|
-
|
|
890
|
+
refresh(uid: string): Promise<{
|
|
667
891
|
/**
|
|
668
892
|
* @description Cambia el nombre del contacto.
|
|
893
|
+
* Renames the contact.
|
|
669
894
|
* @param name Nuevo nombre.
|
|
670
|
-
* @returns true si se guardó correctamente.
|
|
671
895
|
*/
|
|
672
896
|
rename(name: string): Promise<boolean>;
|
|
673
897
|
/**
|
|
674
898
|
* @description Actualiza los datos del perfil desde WhatsApp.
|
|
675
|
-
*
|
|
899
|
+
* Refreshes profile data from WhatsApp.
|
|
676
900
|
*/
|
|
677
901
|
refresh(): Promise</*elided*/ any | null>;
|
|
678
902
|
/**
|
|
679
903
|
* @description Obtiene o crea el chat con este contacto.
|
|
680
|
-
*
|
|
904
|
+
* Gets or creates the chat with this contact.
|
|
681
905
|
*/
|
|
682
906
|
chat(): Promise<{
|
|
907
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
908
|
+
remove(): Promise<boolean>;
|
|
909
|
+
pin(value: boolean): Promise<boolean>;
|
|
910
|
+
archive(value: boolean): Promise<boolean>;
|
|
911
|
+
mute(duration: number | null): Promise<boolean>;
|
|
912
|
+
seen(): Promise<boolean>;
|
|
913
|
+
members(offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
683
914
|
messages(offset?: number, limit?: number): Promise<InstanceType<{
|
|
684
915
|
new (data: import("./Message").IMessage): {
|
|
916
|
+
edit(text: string): Promise<boolean>;
|
|
917
|
+
remove(): Promise<boolean>;
|
|
918
|
+
forward(to_cid: string): Promise<boolean>;
|
|
919
|
+
react(emoji: string): Promise<boolean>;
|
|
920
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
921
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
922
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
923
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
924
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
925
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
685
926
|
stream(): Promise<import("node:stream").Readable>;
|
|
686
927
|
content(): Promise<Buffer>;
|
|
687
928
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -702,11 +943,19 @@ export declare function contact(wa: WhatsApp): {
|
|
|
702
943
|
get deleted_at(): number | null;
|
|
703
944
|
};
|
|
704
945
|
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
946
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
947
|
+
count(cid: string): Promise<number>;
|
|
948
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
949
|
+
edit(text: string): Promise<boolean>;
|
|
950
|
+
remove(): Promise<boolean>;
|
|
951
|
+
forward(to_cid: string): Promise<boolean>;
|
|
952
|
+
react(emoji: string): Promise<boolean>;
|
|
953
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
954
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
955
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
956
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
957
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
958
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
710
959
|
stream(): Promise<import("node:stream").Readable>;
|
|
711
960
|
content(): Promise<Buffer>;
|
|
712
961
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -726,7 +975,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
726
975
|
get created_at(): number;
|
|
727
976
|
get deleted_at(): number | null;
|
|
728
977
|
} | null>;
|
|
729
|
-
image(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
978
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
979
|
+
edit(text: string): Promise<boolean>;
|
|
980
|
+
remove(): Promise<boolean>;
|
|
981
|
+
forward(to_cid: string): Promise<boolean>;
|
|
982
|
+
react(emoji: string): Promise<boolean>;
|
|
983
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
984
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
985
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
986
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
987
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
988
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
730
989
|
stream(): Promise<import("node:stream").Readable>;
|
|
731
990
|
content(): Promise<Buffer>;
|
|
732
991
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -746,7 +1005,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
746
1005
|
get created_at(): number;
|
|
747
1006
|
get deleted_at(): number | null;
|
|
748
1007
|
} | null>;
|
|
749
|
-
video(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
1008
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
1009
|
+
edit(text: string): Promise<boolean>;
|
|
1010
|
+
remove(): Promise<boolean>;
|
|
1011
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1012
|
+
react(emoji: string): Promise<boolean>;
|
|
1013
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1014
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1015
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1016
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1017
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1018
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
750
1019
|
stream(): Promise<import("node:stream").Readable>;
|
|
751
1020
|
content(): Promise<Buffer>;
|
|
752
1021
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -766,7 +1035,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
766
1035
|
get created_at(): number;
|
|
767
1036
|
get deleted_at(): number | null;
|
|
768
1037
|
} | null>;
|
|
769
|
-
audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
|
|
1038
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
1039
|
+
edit(text: string): Promise<boolean>;
|
|
1040
|
+
remove(): Promise<boolean>;
|
|
1041
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1042
|
+
react(emoji: string): Promise<boolean>;
|
|
1043
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1044
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1045
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1046
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1047
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1048
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
770
1049
|
stream(): Promise<import("node:stream").Readable>;
|
|
771
1050
|
content(): Promise<Buffer>;
|
|
772
1051
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -786,7 +1065,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
786
1065
|
get created_at(): number;
|
|
787
1066
|
get deleted_at(): number | null;
|
|
788
1067
|
} | null>;
|
|
789
|
-
location(cid: string, opts: import("./Message").LocationOptions): Promise<{
|
|
1068
|
+
location(cid: string, opts: import("./Message").LocationOptions, mid?: string): Promise<{
|
|
1069
|
+
edit(text: string): Promise<boolean>;
|
|
1070
|
+
remove(): Promise<boolean>;
|
|
1071
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1072
|
+
react(emoji: string): Promise<boolean>;
|
|
1073
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1074
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1075
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1076
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1077
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1078
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
790
1079
|
stream(): Promise<import("node:stream").Readable>;
|
|
791
1080
|
content(): Promise<Buffer>;
|
|
792
1081
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -806,7 +1095,17 @@ export declare function contact(wa: WhatsApp): {
|
|
|
806
1095
|
get created_at(): number;
|
|
807
1096
|
get deleted_at(): number | null;
|
|
808
1097
|
} | null>;
|
|
809
|
-
poll(cid: string, opts: import("./Message").PollOptions): Promise<{
|
|
1098
|
+
poll(cid: string, opts: import("./Message").PollOptions, mid?: string): Promise<{
|
|
1099
|
+
edit(text: string): Promise<boolean>;
|
|
1100
|
+
remove(): Promise<boolean>;
|
|
1101
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1102
|
+
react(emoji: string): Promise<boolean>;
|
|
1103
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1104
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1105
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1106
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1107
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1108
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
810
1109
|
stream(): Promise<import("node:stream").Readable>;
|
|
811
1110
|
content(): Promise<Buffer>;
|
|
812
1111
|
readonly index: import("./Message").IMessageIndex;
|
|
@@ -826,31 +1125,39 @@ export declare function contact(wa: WhatsApp): {
|
|
|
826
1125
|
get created_at(): number;
|
|
827
1126
|
get deleted_at(): number | null;
|
|
828
1127
|
} | null>;
|
|
1128
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
1129
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
1130
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
1131
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
829
1132
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
830
|
-
|
|
1133
|
+
} & {
|
|
1134
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
1135
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
1136
|
+
_notify: (cid: string, mid: string) => void;
|
|
1137
|
+
_build_index: (raw: import("baileys").WAMessage, edited?: boolean) => import("./Message").IMessageIndex;
|
|
831
1138
|
}>[]>;
|
|
832
|
-
|
|
1139
|
+
contact(): Promise<InstanceType</*elided*/ any> | null>;
|
|
833
1140
|
readonly raw: import("./Chat").IChatRaw;
|
|
834
1141
|
get id(): string;
|
|
835
1142
|
get type(): "contact" | "group";
|
|
836
1143
|
get name(): string;
|
|
837
1144
|
get content(): string;
|
|
838
|
-
get
|
|
1145
|
+
get pinned(): boolean;
|
|
839
1146
|
get archived(): boolean;
|
|
840
|
-
get muted(): number
|
|
841
|
-
get
|
|
1147
|
+
get muted(): number;
|
|
1148
|
+
get read(): boolean;
|
|
842
1149
|
get readonly(): boolean;
|
|
843
1150
|
} | null>;
|
|
844
1151
|
readonly raw: IContactRaw;
|
|
845
|
-
/** JID único del contacto */
|
|
1152
|
+
/** JID único del contacto / Unique contact JID */
|
|
846
1153
|
get id(): string;
|
|
847
|
-
/** Nombre del contacto */
|
|
1154
|
+
/** Nombre del contacto / Contact name */
|
|
848
1155
|
get name(): string;
|
|
849
|
-
/** URL de la foto de perfil o null */
|
|
1156
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
850
1157
|
get photo(): string | null;
|
|
851
|
-
/** Número de teléfono sin formato */
|
|
1158
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
852
1159
|
get phone(): string;
|
|
853
|
-
/** Bio del contacto */
|
|
1160
|
+
/** Bio del contacto / Contact bio */
|
|
854
1161
|
get content(): string;
|
|
855
|
-
}
|
|
1162
|
+
} | null>;
|
|
856
1163
|
};
|