@arcaelas/whatsapp 6.1.3 → 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 +144 -152
- package/build/cjs/lib/chat/index.js +138 -209
- 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 -1067
- 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 +144 -152
- package/build/esm/lib/chat/index.js +139 -209
- 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 -1069
- 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;
|
|
@@ -17,12 +20,14 @@ export declare class Chat {
|
|
|
17
20
|
pinned?: number | null;
|
|
18
21
|
mute_end_time?: number | null;
|
|
19
22
|
unread_count?: number | null;
|
|
23
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
24
|
+
activity?: number | null;
|
|
20
25
|
};
|
|
21
26
|
/**
|
|
22
|
-
* @internal Documento crudo
|
|
23
|
-
*
|
|
24
|
-
* Raw
|
|
25
|
-
* `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.
|
|
26
31
|
*/
|
|
27
32
|
constructor(_raw: {
|
|
28
33
|
id: string;
|
|
@@ -31,6 +36,8 @@ export declare class Chat {
|
|
|
31
36
|
pinned?: number | null;
|
|
32
37
|
mute_end_time?: number | null;
|
|
33
38
|
unread_count?: number | null;
|
|
39
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
40
|
+
activity?: number | null;
|
|
34
41
|
});
|
|
35
42
|
/** Teléfono del contacto, o el identificador crudo en grupos y LIDs. / Contact phone, or the raw identifier for groups and LIDs. */
|
|
36
43
|
get id(): string;
|
|
@@ -48,12 +55,19 @@ export declare class Chat {
|
|
|
48
55
|
get muted(): string | null;
|
|
49
56
|
}
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
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.
|
|
53
62
|
*
|
|
54
|
-
* @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
|
|
55
65
|
*/
|
|
56
|
-
export declare function chat(
|
|
66
|
+
export declare function chat(init: {
|
|
67
|
+
wa: WhatsApp;
|
|
68
|
+
engine: Engine;
|
|
69
|
+
socket: WASocket;
|
|
70
|
+
}): {
|
|
57
71
|
new (_raw: {
|
|
58
72
|
id: string;
|
|
59
73
|
name?: string | null;
|
|
@@ -61,28 +75,30 @@ export declare function chat(wa: WhatsApp): {
|
|
|
61
75
|
pinned?: number | null;
|
|
62
76
|
mute_end_time?: number | null;
|
|
63
77
|
unread_count?: number | null;
|
|
78
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
79
|
+
activity?: number | null;
|
|
64
80
|
}): {
|
|
65
81
|
/**
|
|
66
|
-
* Participantes
|
|
67
|
-
*
|
|
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.
|
|
68
84
|
*
|
|
69
85
|
* @param offset - Desplazamiento / Offset
|
|
70
86
|
* @param limit - Tamaño de página / Page size
|
|
71
87
|
* @returns Página de contactos / Contact page
|
|
72
88
|
*/
|
|
73
|
-
members(offset?: number, limit?: number): Promise<
|
|
89
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
74
90
|
/**
|
|
75
|
-
* Descripción
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
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.
|
|
79
95
|
*
|
|
80
|
-
* @returns Descripción, o cadena vacía
|
|
96
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
81
97
|
*/
|
|
82
98
|
content(): Promise<string>;
|
|
83
99
|
/**
|
|
84
|
-
* Mensajes del chat
|
|
85
|
-
* Chat messages
|
|
100
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
101
|
+
* Chat messages, from the most recent to the oldest.
|
|
86
102
|
*
|
|
87
103
|
* @param offset - Desplazamiento / Offset
|
|
88
104
|
* @param limit - Tamaño de página / Page size
|
|
@@ -90,68 +106,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
90
106
|
*/
|
|
91
107
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
92
108
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
109
|
+
* Publica el indicador «escribiendo…».
|
|
110
|
+
* Publishes the "typing…" indicator.
|
|
95
111
|
*
|
|
96
|
-
* @param value - true
|
|
97
|
-
* @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
|
|
98
113
|
*/
|
|
99
114
|
typing(value: boolean): Promise<boolean>;
|
|
100
115
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
116
|
+
* Publica el indicador «grabando audio…».
|
|
117
|
+
* Publishes the "recording audio…" indicator.
|
|
103
118
|
*
|
|
104
|
-
* @param value - true
|
|
105
|
-
* @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
|
|
106
120
|
*/
|
|
107
121
|
recording(value: boolean): Promise<boolean>;
|
|
108
122
|
/**
|
|
109
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
110
|
-
* 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.
|
|
111
125
|
*
|
|
112
126
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
113
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
114
127
|
*/
|
|
115
128
|
archive(value: boolean): Promise<boolean>;
|
|
116
129
|
/**
|
|
117
|
-
* Fija o desfija el chat
|
|
118
|
-
*
|
|
119
|
-
* Pins or unpins the chat
|
|
120
|
-
*
|
|
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.
|
|
121
134
|
*
|
|
122
135
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
123
|
-
* @returns false si
|
|
136
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
124
137
|
*/
|
|
125
138
|
pin(value: boolean): Promise<boolean>;
|
|
126
139
|
/**
|
|
127
|
-
* Silencia el chat hasta la fecha indicada
|
|
128
|
-
* 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.
|
|
129
142
|
*
|
|
130
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
131
|
-
* @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
|
|
132
144
|
*/
|
|
133
145
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
134
146
|
/**
|
|
135
|
-
* Marca el chat completo como leído en la cuenta
|
|
136
|
-
* Marks the whole chat as read on the
|
|
137
|
-
*
|
|
138
|
-
* @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.
|
|
139
149
|
*/
|
|
140
150
|
seen(): Promise<boolean>;
|
|
141
151
|
/**
|
|
142
|
-
* Vacía los mensajes del chat en la cuenta
|
|
143
|
-
* Clears the chat messages on the
|
|
144
|
-
*
|
|
145
|
-
* @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.
|
|
146
154
|
*/
|
|
147
155
|
clear(): Promise<boolean>;
|
|
148
156
|
/**
|
|
149
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
150
|
-
*
|
|
151
|
-
* Deletes the chat and its messages on the
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @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.
|
|
155
161
|
*/
|
|
156
162
|
delete(): Promise<boolean>;
|
|
157
163
|
readonly _raw: {
|
|
@@ -161,6 +167,8 @@ export declare function chat(wa: WhatsApp): {
|
|
|
161
167
|
pinned?: number | null;
|
|
162
168
|
mute_end_time?: number | null;
|
|
163
169
|
unread_count?: number | null;
|
|
170
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
171
|
+
activity?: number | null;
|
|
164
172
|
};
|
|
165
173
|
/** Teléfono del contacto, o el identificador crudo en grupos y LIDs. / Contact phone, or the raw identifier for groups and LIDs. */
|
|
166
174
|
get id(): string;
|
|
@@ -178,36 +186,36 @@ export declare function chat(wa: WhatsApp): {
|
|
|
178
186
|
get muted(): string | null;
|
|
179
187
|
};
|
|
180
188
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
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.
|
|
185
193
|
*
|
|
186
194
|
* @param cid - Teléfono, JID, LID o id de grupo / Phone, JID, LID or group id
|
|
187
|
-
* @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
|
|
188
196
|
*/
|
|
189
197
|
get(cid: string | number): Promise<{
|
|
190
198
|
/**
|
|
191
|
-
* Participantes
|
|
192
|
-
*
|
|
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.
|
|
193
201
|
*
|
|
194
202
|
* @param offset - Desplazamiento / Offset
|
|
195
203
|
* @param limit - Tamaño de página / Page size
|
|
196
204
|
* @returns Página de contactos / Contact page
|
|
197
205
|
*/
|
|
198
|
-
members(offset?: number, limit?: number): Promise<
|
|
206
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
199
207
|
/**
|
|
200
|
-
* Descripción
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
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.
|
|
204
212
|
*
|
|
205
|
-
* @returns Descripción, o cadena vacía
|
|
213
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
206
214
|
*/
|
|
207
215
|
content(): Promise<string>;
|
|
208
216
|
/**
|
|
209
|
-
* Mensajes del chat
|
|
210
|
-
* Chat messages
|
|
217
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
218
|
+
* Chat messages, from the most recent to the oldest.
|
|
211
219
|
*
|
|
212
220
|
* @param offset - Desplazamiento / Offset
|
|
213
221
|
* @param limit - Tamaño de página / Page size
|
|
@@ -215,68 +223,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
215
223
|
*/
|
|
216
224
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
217
225
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
226
|
+
* Publica el indicador «escribiendo…».
|
|
227
|
+
* Publishes the "typing…" indicator.
|
|
220
228
|
*
|
|
221
|
-
* @param value - true
|
|
222
|
-
* @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
|
|
223
230
|
*/
|
|
224
231
|
typing(value: boolean): Promise<boolean>;
|
|
225
232
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
233
|
+
* Publica el indicador «grabando audio…».
|
|
234
|
+
* Publishes the "recording audio…" indicator.
|
|
228
235
|
*
|
|
229
|
-
* @param value - true
|
|
230
|
-
* @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
|
|
231
237
|
*/
|
|
232
238
|
recording(value: boolean): Promise<boolean>;
|
|
233
239
|
/**
|
|
234
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
235
|
-
* 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.
|
|
236
242
|
*
|
|
237
243
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
238
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
239
244
|
*/
|
|
240
245
|
archive(value: boolean): Promise<boolean>;
|
|
241
246
|
/**
|
|
242
|
-
* Fija o desfija el chat
|
|
243
|
-
*
|
|
244
|
-
* Pins or unpins the chat
|
|
245
|
-
*
|
|
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.
|
|
246
251
|
*
|
|
247
252
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
248
|
-
* @returns false si
|
|
253
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
249
254
|
*/
|
|
250
255
|
pin(value: boolean): Promise<boolean>;
|
|
251
256
|
/**
|
|
252
|
-
* Silencia el chat hasta la fecha indicada
|
|
253
|
-
* 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.
|
|
254
259
|
*
|
|
255
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
256
|
-
* @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
|
|
257
261
|
*/
|
|
258
262
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
259
263
|
/**
|
|
260
|
-
* Marca el chat completo como leído en la cuenta
|
|
261
|
-
* Marks the whole chat as read on the
|
|
262
|
-
*
|
|
263
|
-
* @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.
|
|
264
266
|
*/
|
|
265
267
|
seen(): Promise<boolean>;
|
|
266
268
|
/**
|
|
267
|
-
* Vacía los mensajes del chat en la cuenta
|
|
268
|
-
* Clears the chat messages on the
|
|
269
|
-
*
|
|
270
|
-
* @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.
|
|
271
271
|
*/
|
|
272
272
|
clear(): Promise<boolean>;
|
|
273
273
|
/**
|
|
274
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
275
|
-
*
|
|
276
|
-
* Deletes the chat and its messages on the
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* @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.
|
|
280
278
|
*/
|
|
281
279
|
delete(): Promise<boolean>;
|
|
282
280
|
readonly _raw: {
|
|
@@ -286,6 +284,8 @@ export declare function chat(wa: WhatsApp): {
|
|
|
286
284
|
pinned?: number | null;
|
|
287
285
|
mute_end_time?: number | null;
|
|
288
286
|
unread_count?: number | null;
|
|
287
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
288
|
+
activity?: number | null;
|
|
289
289
|
};
|
|
290
290
|
/** Teléfono del contacto, o el identificador crudo en grupos y LIDs. / Contact phone, or the raw identifier for groups and LIDs. */
|
|
291
291
|
get id(): string;
|
|
@@ -303,8 +303,8 @@ export declare function chat(wa: WhatsApp): {
|
|
|
303
303
|
get muted(): string | null;
|
|
304
304
|
} | null>;
|
|
305
305
|
/**
|
|
306
|
-
* Pagina los chats persistidos, del más
|
|
307
|
-
* 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.
|
|
308
308
|
*
|
|
309
309
|
* @param offset - Desplazamiento / Offset
|
|
310
310
|
* @param limit - Tamaño de página / Page size
|
|
@@ -312,26 +312,26 @@ export declare function chat(wa: WhatsApp): {
|
|
|
312
312
|
*/
|
|
313
313
|
list(offset?: number, limit?: number): Promise<{
|
|
314
314
|
/**
|
|
315
|
-
* Participantes
|
|
316
|
-
*
|
|
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.
|
|
317
317
|
*
|
|
318
318
|
* @param offset - Desplazamiento / Offset
|
|
319
319
|
* @param limit - Tamaño de página / Page size
|
|
320
320
|
* @returns Página de contactos / Contact page
|
|
321
321
|
*/
|
|
322
|
-
members(offset?: number, limit?: number): Promise<
|
|
322
|
+
members(offset?: number, limit?: number): Promise<Contact[]>;
|
|
323
323
|
/**
|
|
324
|
-
* Descripción
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
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.
|
|
328
328
|
*
|
|
329
|
-
* @returns Descripción, o cadena vacía
|
|
329
|
+
* @returns Descripción, o cadena vacía / Description, or an empty string
|
|
330
330
|
*/
|
|
331
331
|
content(): Promise<string>;
|
|
332
332
|
/**
|
|
333
|
-
* Mensajes del chat
|
|
334
|
-
* Chat messages
|
|
333
|
+
* Mensajes del chat, del más reciente al más antiguo.
|
|
334
|
+
* Chat messages, from the most recent to the oldest.
|
|
335
335
|
*
|
|
336
336
|
* @param offset - Desplazamiento / Offset
|
|
337
337
|
* @param limit - Tamaño de página / Page size
|
|
@@ -339,68 +339,58 @@ export declare function chat(wa: WhatsApp): {
|
|
|
339
339
|
*/
|
|
340
340
|
messages(offset?: number, limit?: number): Promise<Message[]>;
|
|
341
341
|
/**
|
|
342
|
-
*
|
|
343
|
-
*
|
|
342
|
+
* Publica el indicador «escribiendo…».
|
|
343
|
+
* Publishes the "typing…" indicator.
|
|
344
344
|
*
|
|
345
|
-
* @param value - true
|
|
346
|
-
* @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
|
|
347
346
|
*/
|
|
348
347
|
typing(value: boolean): Promise<boolean>;
|
|
349
348
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
349
|
+
* Publica el indicador «grabando audio…».
|
|
350
|
+
* Publishes the "recording audio…" indicator.
|
|
352
351
|
*
|
|
353
|
-
* @param value - true
|
|
354
|
-
* @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
|
|
355
353
|
*/
|
|
356
354
|
recording(value: boolean): Promise<boolean>;
|
|
357
355
|
/**
|
|
358
|
-
* Archiva o desarchiva el chat en la cuenta
|
|
359
|
-
* 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.
|
|
360
358
|
*
|
|
361
359
|
* @param value - true archiva, false desarchiva / true archives, false unarchives
|
|
362
|
-
* @returns true si la acción se envió / true when the action was sent
|
|
363
360
|
*/
|
|
364
361
|
archive(value: boolean): Promise<boolean>;
|
|
365
362
|
/**
|
|
366
|
-
* Fija o desfija el chat
|
|
367
|
-
*
|
|
368
|
-
* Pins or unpins the chat
|
|
369
|
-
*
|
|
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.
|
|
370
367
|
*
|
|
371
368
|
* @param value - true fija, false desfija / true pins, false unpins
|
|
372
|
-
* @returns false si
|
|
369
|
+
* @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
|
|
373
370
|
*/
|
|
374
371
|
pin(value: boolean): Promise<boolean>;
|
|
375
372
|
/**
|
|
376
|
-
* Silencia el chat hasta la fecha indicada
|
|
377
|
-
* 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.
|
|
378
375
|
*
|
|
379
|
-
* @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
|
|
380
|
-
* @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
|
|
381
377
|
*/
|
|
382
378
|
mute(until: string | number | Date | false): Promise<boolean>;
|
|
383
379
|
/**
|
|
384
|
-
* Marca el chat completo como leído en la cuenta
|
|
385
|
-
* Marks the whole chat as read on the
|
|
386
|
-
*
|
|
387
|
-
* @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.
|
|
388
382
|
*/
|
|
389
383
|
seen(): Promise<boolean>;
|
|
390
384
|
/**
|
|
391
|
-
* Vacía los mensajes del chat en la cuenta
|
|
392
|
-
* Clears the chat messages on the
|
|
393
|
-
*
|
|
394
|
-
* @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.
|
|
395
387
|
*/
|
|
396
388
|
clear(): Promise<boolean>;
|
|
397
389
|
/**
|
|
398
|
-
* Elimina el chat y sus mensajes en la cuenta
|
|
399
|
-
*
|
|
400
|
-
* Deletes the chat and its messages on the
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* @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.
|
|
404
394
|
*/
|
|
405
395
|
delete(): Promise<boolean>;
|
|
406
396
|
readonly _raw: {
|
|
@@ -410,6 +400,8 @@ export declare function chat(wa: WhatsApp): {
|
|
|
410
400
|
pinned?: number | null;
|
|
411
401
|
mute_end_time?: number | null;
|
|
412
402
|
unread_count?: number | null;
|
|
403
|
+
/** Epoch ms del último mensaje: ordena la lista y sobrevive a las escrituras de flags. / Last message epoch ms: orders the list and survives flag writes. */
|
|
404
|
+
activity?: number | null;
|
|
413
405
|
};
|
|
414
406
|
/** Teléfono del contacto, o el identificador crudo en grupos y LIDs. / Contact phone, or the raw identifier for groups and LIDs. */
|
|
415
407
|
get id(): string;
|