@arcaelas/whatsapp 6.2.0 → 7.0.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/README.md +19 -15
- package/build/cjs/index.d.ts +9 -5
- package/build/cjs/index.js +8 -7
- package/build/cjs/lib/bot/decorator.d.ts +2 -9
- package/build/cjs/lib/bot/decorator.js +0 -1
- package/build/cjs/lib/bot/decorators.d.ts +48 -4
- package/build/cjs/lib/bot/decorators.js +2 -2
- package/build/cjs/lib/chat/index.d.ts +132 -152
- package/build/cjs/lib/chat/index.js +138 -219
- package/build/cjs/lib/contact/index.d.ts +114 -80
- package/build/cjs/lib/contact/index.js +187 -94
- package/build/cjs/lib/message/index.d.ts +400 -321
- package/build/cjs/lib/message/index.js +425 -913
- package/build/cjs/lib/status/index.d.ts +22 -33
- package/build/cjs/lib/status/index.js +52 -93
- package/build/cjs/lib/store/index.d.ts +16 -0
- package/build/cjs/lib/store/index.js +29 -3
- package/build/cjs/lib/whatsapp/index.d.ts +44 -212
- package/build/cjs/lib/whatsapp/index.js +473 -1099
- package/build/esm/index.d.ts +9 -5
- package/build/esm/index.js +6 -4
- package/build/esm/lib/bot/decorator.d.ts +2 -9
- package/build/esm/lib/bot/decorator.js +1 -1
- package/build/esm/lib/bot/decorators.d.ts +48 -4
- package/build/esm/lib/bot/decorators.js +2 -2
- package/build/esm/lib/chat/index.d.ts +132 -152
- package/build/esm/lib/chat/index.js +139 -219
- package/build/esm/lib/contact/index.d.ts +114 -80
- package/build/esm/lib/contact/index.js +186 -94
- package/build/esm/lib/message/index.d.ts +400 -321
- package/build/esm/lib/message/index.js +422 -913
- package/build/esm/lib/status/index.d.ts +22 -33
- package/build/esm/lib/status/index.js +49 -93
- package/build/esm/lib/store/index.d.ts +16 -0
- package/build/esm/lib/store/index.js +25 -0
- package/build/esm/lib/whatsapp/index.d.ts +44 -212
- package/build/esm/lib/whatsapp/index.js +476 -1101
- package/package.json +1 -1
- package/build/cjs/lib/internal.d.ts +0 -40
- package/build/cjs/lib/internal.js +0 -38
- package/build/esm/lib/internal.d.ts +0 -40
- package/build/esm/lib/internal.js +0 -34
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
* @description Entidad Chat — conversaciones individuales y grupales.
|
|
4
4
|
* Chat entity — individual and group conversations.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import type
|
|
6
|
+
import type { WASocket } from 'baileys';
|
|
7
|
+
import type Contact from '../../lib/contact';
|
|
8
|
+
import type Message from '../../lib/message';
|
|
9
|
+
import { type Engine } from '../../lib/store';
|
|
10
|
+
import type WhatsApp from '../../lib/whatsapp';
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* Chat: recibe el raw y deriva todo con getters.
|
|
13
|
+
* Chat: receives the raw and derives everything via getters.
|
|
11
14
|
*/
|
|
12
|
-
export
|
|
15
|
+
export default class Chat {
|
|
13
16
|
readonly _raw: {
|
|
14
17
|
id: string;
|
|
15
18
|
name?: string | null;
|
|
@@ -21,10 +24,10 @@ export declare class Chat {
|
|
|
21
24
|
activity?: number | null;
|
|
22
25
|
};
|
|
23
26
|
/**
|
|
24
|
-
* @internal Documento crudo
|
|
25
|
-
*
|
|
26
|
-
* Raw
|
|
27
|
-
* `mute_end_time` are epoch ms.
|
|
27
|
+
* @internal Documento crudo. `id` es el identificador del engine (JID, LID o `@g.us`);
|
|
28
|
+
* `pinned`, `mute_end_time` y `activity` son epoch ms.
|
|
29
|
+
* Raw document. `id` is the engine identifier (JID, LID or `@g.us`); `pinned`,
|
|
30
|
+
* `mute_end_time` and `activity` are epoch ms.
|
|
28
31
|
*/
|
|
29
32
|
constructor(_raw: {
|
|
30
33
|
id: string;
|
|
@@ -52,12 +55,19 @@ export declare class Chat {
|
|
|
52
55
|
get muted(): string | null;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
58
|
+
* Chat ligado a la sesión viva: el socket y el engine llegan resueltos, así que sus métodos
|
|
59
|
+
* no vuelven a comprobarlos.
|
|
60
|
+
* Chat bound to the live session: socket and engine arrive resolved, so its methods do not
|
|
61
|
+
* check them again.
|
|
57
62
|
*
|
|
58
|
-
* @param
|
|
63
|
+
* @param init - Sesión activa: cliente, motor y socket / Active session: client, engine and socket
|
|
64
|
+
* @returns Clase `Chat` con acceso a la sesión / `Chat` class with session access
|
|
59
65
|
*/
|
|
60
|
-
export declare function chat(
|
|
66
|
+
export declare function chat(init: {
|
|
67
|
+
wa: WhatsApp;
|
|
68
|
+
engine: Engine;
|
|
69
|
+
socket: WASocket;
|
|
70
|
+
}): {
|
|
61
71
|
new (_raw: {
|
|
62
72
|
id: string;
|
|
63
73
|
name?: string | null;
|
|
@@ -69,26 +79,26 @@ export declare function chat(wa: WhatsApp): {
|
|
|
69
79
|
activity?: number | null;
|
|
70
80
|
}): {
|
|
71
81
|
/**
|
|
72
|
-
* Participantes
|
|
73
|
-
*
|
|
82
|
+
* Participantes: los integrantes en grupos, el contacto y yo en 1:1.
|
|
83
|
+
* Participants: members for groups, the contact and myself for 1:1.
|
|
74
84
|
*
|
|
75
85
|
* @param offset - Desplazamiento / Offset
|
|
76
86
|
* @param limit - Tamaño de página / Page size
|
|
77
87
|
* @returns Página de contactos / Contact page
|
|
78
88
|
*/
|
|
79
|
-
members(offset?: number, limit?: number): Promise<
|
|
89
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
80
90
|
/**
|
|
81
|
-
* Descripción
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
91
|
+
* Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
|
|
92
|
+
* porque ninguna de las dos vive en el documento del chat.
|
|
93
|
+
* Description: the group's subject or, on a 1:1, the contact's bio. It is async because
|
|
94
|
+
* neither of them lives in the chat document.
|
|
85
95
|
*
|
|
86
|
-
* @returns Descripción, o cadena vacía
|
|
96
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
87
97
|
*/
|
|
88
98
|
content(): Promise<string>;
|
|
89
99
|
/**
|
|
90
|
-
* Mensajes del chat
|
|
91
|
-
* Chat messages
|
|
100
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
101
|
+
* Chat messages, from the most recent to the oldest.
|
|
92
102
|
*
|
|
93
103
|
* @param offset - Desplazamiento / Offset
|
|
94
104
|
* @param limit - Tamaño de página / Page size
|
|
@@ -96,68 +106,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
96
106
|
*/
|
|
97
107
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
98
108
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
109
|
+
* Publica el indicador «escribiendo…».
|
|
110
|
+
* Publishes the "typing…" indicator.
|
|
101
111
|
*
|
|
102
|
-
* @param value - true
|
|
103
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
112
|
+
* @param value - true escribe, false vuelve a pausa / true types, false returns to paused
|
|
104
113
|
*/
|
|
105
114
|
typing(value: boolean): Promise<boolean>;
|
|
106
115
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
116
|
+
* Publica el indicador «grabando audio…».
|
|
117
|
+
* Publishes the "recording audio…" indicator.
|
|
109
118
|
*
|
|
110
|
-
* @param value - true
|
|
111
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
119
|
+
* @param value - true graba, false vuelve a pausa / true records, false returns to paused
|
|
112
120
|
*/
|
|
113
121
|
recording(value: boolean): Promise<boolean>;
|
|
114
122
|
/**
|
|
115
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
116
|
-
* Archives or unarchives the chat on the
|
|
123
|
+
* Archiva o desarchiva el chat en la cuenta.
|
|
124
|
+
* Archives or unarchives the chat on the account.
|
|
117
125
|
*
|
|
118
126
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
119
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
120
127
|
*/
|
|
121
128
|
archive(value: boolean): Promise<boolean>;
|
|
122
129
|
/**
|
|
123
|
-
* Fija o desfija el chat
|
|
124
|
-
*
|
|
125
|
-
* Pins or unpins the chat
|
|
126
|
-
*
|
|
130
|
+
* Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
|
|
131
|
+
* cuarto chat fijado sin avisar.
|
|
132
|
+
* Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
|
|
133
|
+
* drops the fourth pinned chat.
|
|
127
134
|
*
|
|
128
135
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
129
|
-
* @returns false si
|
|
136
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
130
137
|
*/
|
|
131
138
|
pin(value: boolean): Promise<boolean>;
|
|
132
139
|
/**
|
|
133
|
-
* Silencia el chat hasta la fecha indicada
|
|
134
|
-
* Mutes the chat until the given date
|
|
140
|
+
* Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
|
|
141
|
+
* Mutes the chat until the given date; `false` or a past date unmutes it.
|
|
135
142
|
*
|
|
136
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
137
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
143
|
+
* @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
|
|
138
144
|
*/
|
|
139
145
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
140
146
|
/**
|
|
141
|
-
* Marca el chat completo como leído en la cuenta
|
|
142
|
-
* Marks the whole chat as read on the
|
|
143
|
-
*
|
|
144
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
147
|
+
* Marca el chat completo como leído en la cuenta.
|
|
148
|
+
* Marks the whole chat as read on the account.
|
|
145
149
|
*/
|
|
146
150
|
seen(): Promise<boolean>;
|
|
147
151
|
/**
|
|
148
|
-
* Vacía los mensajes del chat en la cuenta
|
|
149
|
-
* Clears the chat messages on the
|
|
150
|
-
*
|
|
151
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
152
|
+
* Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
|
|
153
|
+
* Clears the chat messages on the account and in the engine, keeping the chat.
|
|
152
154
|
*/
|
|
153
155
|
clear(): Promise<boolean>;
|
|
154
156
|
/**
|
|
155
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
156
|
-
*
|
|
157
|
-
* Deletes the chat and its messages on the
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
157
|
+
* Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
|
|
158
|
+
* del grupo.
|
|
159
|
+
* Deletes the chat and its messages on the account and in the engine; for groups it
|
|
160
|
+
* also leaves the group.
|
|
161
161
|
*/
|
|
162
162
|
delete(): Promise<boolean>;
|
|
163
163
|
readonly _raw: {
|
|
@@ -186,36 +186,36 @@ export declare function chat(wa: WhatsApp): {
|
|
|
186
186
|
get muted(): string | null;
|
|
187
187
|
};
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
189
|
+
* Chat por teléfono, JID, LID o id de grupo: el persistido o, si no existe todavía,
|
|
190
|
+
* una instancia mínima lista para usar que no se persiste.
|
|
191
|
+
* Chat by phone, JID, LID or group id: the persisted one or, when it does not exist
|
|
192
|
+
* yet, a minimal ready-to-use instance that is not persisted.
|
|
193
193
|
*
|
|
194
194
|
* @param cid - Teléfono, JID, LID o id de grupo / Phone, JID, LID or group id
|
|
195
|
-
* @returns Chat o null si el identificador es irresoluble / Chat or null when the identifier cannot be resolved
|
|
195
|
+
* @returns Chat, o null si el identificador es irresoluble / Chat, or null when the identifier cannot be resolved
|
|
196
196
|
*/
|
|
197
197
|
get(cid: string | number): Promise<{
|
|
198
198
|
/**
|
|
199
|
-
* Participantes
|
|
200
|
-
*
|
|
199
|
+
* Participantes: los integrantes en grupos, el contacto y yo en 1:1.
|
|
200
|
+
* Participants: members for groups, the contact and myself for 1:1.
|
|
201
201
|
*
|
|
202
202
|
* @param offset - Desplazamiento / Offset
|
|
203
203
|
* @param limit - Tamaño de página / Page size
|
|
204
204
|
* @returns Página de contactos / Contact page
|
|
205
205
|
*/
|
|
206
|
-
members(offset?: number, limit?: number): Promise<
|
|
206
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
207
207
|
/**
|
|
208
|
-
* Descripción
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
208
|
+
* Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
|
|
209
|
+
* porque ninguna de las dos vive en el documento del chat.
|
|
210
|
+
* Description: the group's subject or, on a 1:1, the contact's bio. It is async because
|
|
211
|
+
* neither of them lives in the chat document.
|
|
212
212
|
*
|
|
213
|
-
* @returns Descripción, o cadena vacía
|
|
213
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
214
214
|
*/
|
|
215
215
|
content(): Promise<string>;
|
|
216
216
|
/**
|
|
217
|
-
* Mensajes del chat
|
|
218
|
-
* Chat messages
|
|
217
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
218
|
+
* Chat messages, from the most recent to the oldest.
|
|
219
219
|
*
|
|
220
220
|
* @param offset - Desplazamiento / Offset
|
|
221
221
|
* @param limit - Tamaño de página / Page size
|
|
@@ -223,68 +223,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
223
223
|
*/
|
|
224
224
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
225
225
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
226
|
+
* Publica el indicador «escribiendo…».
|
|
227
|
+
* Publishes the "typing…" indicator.
|
|
228
228
|
*
|
|
229
|
-
* @param value - true
|
|
230
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
229
|
+
* @param value - true escribe, false vuelve a pausa / true types, false returns to paused
|
|
231
230
|
*/
|
|
232
231
|
typing(value: boolean): Promise<boolean>;
|
|
233
232
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
233
|
+
* Publica el indicador «grabando audio…».
|
|
234
|
+
* Publishes the "recording audio…" indicator.
|
|
236
235
|
*
|
|
237
|
-
* @param value - true
|
|
238
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
236
|
+
* @param value - true graba, false vuelve a pausa / true records, false returns to paused
|
|
239
237
|
*/
|
|
240
238
|
recording(value: boolean): Promise<boolean>;
|
|
241
239
|
/**
|
|
242
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
243
|
-
* Archives or unarchives the chat on the
|
|
240
|
+
* Archiva o desarchiva el chat en la cuenta.
|
|
241
|
+
* Archives or unarchives the chat on the account.
|
|
244
242
|
*
|
|
245
243
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
246
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
247
244
|
*/
|
|
248
245
|
archive(value: boolean): Promise<boolean>;
|
|
249
246
|
/**
|
|
250
|
-
* Fija o desfija el chat
|
|
251
|
-
*
|
|
252
|
-
* Pins or unpins the chat
|
|
253
|
-
*
|
|
247
|
+
* Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
|
|
248
|
+
* cuarto chat fijado sin avisar.
|
|
249
|
+
* Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
|
|
250
|
+
* drops the fourth pinned chat.
|
|
254
251
|
*
|
|
255
252
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
256
|
-
* @returns false si
|
|
253
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
257
254
|
*/
|
|
258
255
|
pin(value: boolean): Promise<boolean>;
|
|
259
256
|
/**
|
|
260
|
-
* Silencia el chat hasta la fecha indicada
|
|
261
|
-
* Mutes the chat until the given date
|
|
257
|
+
* Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
|
|
258
|
+
* Mutes the chat until the given date; `false` or a past date unmutes it.
|
|
262
259
|
*
|
|
263
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
264
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
260
|
+
* @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
|
|
265
261
|
*/
|
|
266
262
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
267
263
|
/**
|
|
268
|
-
* Marca el chat completo como leído en la cuenta
|
|
269
|
-
* Marks the whole chat as read on the
|
|
270
|
-
*
|
|
271
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
264
|
+
* Marca el chat completo como leído en la cuenta.
|
|
265
|
+
* Marks the whole chat as read on the account.
|
|
272
266
|
*/
|
|
273
267
|
seen(): Promise<boolean>;
|
|
274
268
|
/**
|
|
275
|
-
* Vacía los mensajes del chat en la cuenta
|
|
276
|
-
* Clears the chat messages on the
|
|
277
|
-
*
|
|
278
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
269
|
+
* Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
|
|
270
|
+
* Clears the chat messages on the account and in the engine, keeping the chat.
|
|
279
271
|
*/
|
|
280
272
|
clear(): Promise<boolean>;
|
|
281
273
|
/**
|
|
282
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
283
|
-
*
|
|
284
|
-
* Deletes the chat and its messages on the
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
274
|
+
* Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
|
|
275
|
+
* del grupo.
|
|
276
|
+
* Deletes the chat and its messages on the account and in the engine; for groups it
|
|
277
|
+
* also leaves the group.
|
|
288
278
|
*/
|
|
289
279
|
delete(): Promise<boolean>;
|
|
290
280
|
readonly _raw: {
|
|
@@ -313,8 +303,8 @@ export declare function chat(wa: WhatsApp): {
|
|
|
313
303
|
get muted(): string | null;
|
|
314
304
|
} | null>;
|
|
315
305
|
/**
|
|
316
|
-
* Pagina los chats persistidos, del más
|
|
317
|
-
* Paginates persisted chats, from the most
|
|
306
|
+
* Pagina los chats persistidos, del más activo al más antiguo.
|
|
307
|
+
* Paginates persisted chats, from the most active to the oldest.
|
|
318
308
|
*
|
|
319
309
|
* @param offset - Desplazamiento / Offset
|
|
320
310
|
* @param limit - Tamaño de página / Page size
|
|
@@ -322,26 +312,26 @@ export declare function chat(wa: WhatsApp): {
|
|
|
322
312
|
*/
|
|
323
313
|
list(offset?: number, limit?: number): Promise<{
|
|
324
314
|
/**
|
|
325
|
-
* Participantes
|
|
326
|
-
*
|
|
315
|
+
* Participantes: los integrantes en grupos, el contacto y yo en 1:1.
|
|
316
|
+
* Participants: members for groups, the contact and myself for 1:1.
|
|
327
317
|
*
|
|
328
318
|
* @param offset - Desplazamiento / Offset
|
|
329
319
|
* @param limit - Tamaño de página / Page size
|
|
330
320
|
* @returns Página de contactos / Contact page
|
|
331
321
|
*/
|
|
332
|
-
members(offset?: number, limit?: number): Promise<
|
|
322
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
333
323
|
/**
|
|
334
|
-
* Descripción
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
324
|
+
* Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
|
|
325
|
+
* porque ninguna de las dos vive en el documento del chat.
|
|
326
|
+
* Description: the group's subject or, on a 1:1, the contact's bio. It is async because
|
|
327
|
+
* neither of them lives in the chat document.
|
|
338
328
|
*
|
|
339
|
-
* @returns Descripción, o cadena vacía
|
|
329
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
340
330
|
*/
|
|
341
331
|
content(): Promise<string>;
|
|
342
332
|
/**
|
|
343
|
-
* Mensajes del chat
|
|
344
|
-
* Chat messages
|
|
333
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
334
|
+
* Chat messages, from the most recent to the oldest.
|
|
345
335
|
*
|
|
346
336
|
* @param offset - Desplazamiento / Offset
|
|
347
337
|
* @param limit - Tamaño de página / Page size
|
|
@@ -349,68 +339,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
349
339
|
*/
|
|
350
340
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
351
341
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
342
|
+
* Publica el indicador «escribiendo…».
|
|
343
|
+
* Publishes the "typing…" indicator.
|
|
354
344
|
*
|
|
355
|
-
* @param value - true
|
|
356
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
345
|
+
* @param value - true escribe, false vuelve a pausa / true types, false returns to paused
|
|
357
346
|
*/
|
|
358
347
|
typing(value: boolean): Promise<boolean>;
|
|
359
348
|
/**
|
|
360
|
-
*
|
|
361
|
-
*
|
|
349
|
+
* Publica el indicador «grabando audio…».
|
|
350
|
+
* Publishes the "recording audio…" indicator.
|
|
362
351
|
*
|
|
363
|
-
* @param value - true
|
|
364
|
-
* @returns true si el socket estaba disponible / true when the socket was available
|
|
352
|
+
* @param value - true graba, false vuelve a pausa / true records, false returns to paused
|
|
365
353
|
*/
|
|
366
354
|
recording(value: boolean): Promise<boolean>;
|
|
367
355
|
/**
|
|
368
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
369
|
-
* Archives or unarchives the chat on the
|
|
356
|
+
* Archiva o desarchiva el chat en la cuenta.
|
|
357
|
+
* Archives or unarchives the chat on the account.
|
|
370
358
|
*
|
|
371
359
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
372
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
373
360
|
*/
|
|
374
361
|
archive(value: boolean): Promise<boolean>;
|
|
375
362
|
/**
|
|
376
|
-
* Fija o desfija el chat
|
|
377
|
-
*
|
|
378
|
-
* Pins or unpins the chat
|
|
379
|
-
*
|
|
363
|
+
* Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
|
|
364
|
+
* cuarto chat fijado sin avisar.
|
|
365
|
+
* Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
|
|
366
|
+
* drops the fourth pinned chat.
|
|
380
367
|
*
|
|
381
368
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
382
|
-
* @returns false si
|
|
369
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
383
370
|
*/
|
|
384
371
|
pin(value: boolean): Promise<boolean>;
|
|
385
372
|
/**
|
|
386
|
-
* Silencia el chat hasta la fecha indicada
|
|
387
|
-
* Mutes the chat until the given date
|
|
373
|
+
* Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
|
|
374
|
+
* Mutes the chat until the given date; `false` or a past date unmutes it.
|
|
388
375
|
*
|
|
389
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
390
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
376
|
+
* @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
|
|
391
377
|
*/
|
|
392
378
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
393
379
|
/**
|
|
394
|
-
* Marca el chat completo como leído en la cuenta
|
|
395
|
-
* Marks the whole chat as read on the
|
|
396
|
-
*
|
|
397
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
380
|
+
* Marca el chat completo como leído en la cuenta.
|
|
381
|
+
* Marks the whole chat as read on the account.
|
|
398
382
|
*/
|
|
399
383
|
seen(): Promise<boolean>;
|
|
400
384
|
/**
|
|
401
|
-
* Vacía los mensajes del chat en la cuenta
|
|
402
|
-
* Clears the chat messages on the
|
|
403
|
-
*
|
|
404
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
385
|
+
* Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
|
|
386
|
+
* Clears the chat messages on the account and in the engine, keeping the chat.
|
|
405
387
|
*/
|
|
406
388
|
clear(): Promise<boolean>;
|
|
407
389
|
/**
|
|
408
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
409
|
-
*
|
|
410
|
-
* Deletes the chat and its messages on the
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
* @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
|
|
390
|
+
* Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
|
|
391
|
+
* del grupo.
|
|
392
|
+
* Deletes the chat and its messages on the account and in the engine; for groups it
|
|
393
|
+
* also leaves the group.
|
|
414
394
|
*/
|
|
415
395
|
delete(): Promise<boolean>;
|
|
416
396
|
readonly _raw: {
|