@arcaelas/whatsapp 1.4.0 → 2.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/build/cjs/Chat.d.ts +187 -205
- package/build/cjs/Chat.js +151 -274
- package/build/cjs/Chat.js.map +1 -1
- package/build/cjs/Contact.d.ts +317 -304
- package/build/cjs/Contact.js +58 -103
- package/build/cjs/Contact.js.map +1 -1
- package/build/cjs/Message.d.ts +567 -265
- package/build/cjs/Message.js +274 -256
- package/build/cjs/Message.js.map +1 -1
- package/build/cjs/WhatsApp.d.ts +16 -4
- package/build/cjs/WhatsApp.js +77 -79
- 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 +187 -205
- package/build/esm/Chat.js +151 -273
- package/build/esm/Chat.js.map +1 -1
- package/build/esm/Contact.d.ts +317 -304
- package/build/esm/Contact.js +58 -102
- package/build/esm/Contact.js.map +1 -1
- package/build/esm/Message.d.ts +567 -265
- package/build/esm/Message.js +275 -256
- package/build/esm/Message.js.map +1 -1
- package/build/esm/WhatsApp.d.ts +16 -4
- package/build/esm/WhatsApp.js +80 -82
- 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/Message.d.ts
CHANGED
|
@@ -7,574 +7,876 @@ import { Readable } from 'node:stream';
|
|
|
7
7
|
import type { WhatsApp } from './WhatsApp';
|
|
8
8
|
/**
|
|
9
9
|
* @description Tipos de mensaje soportados.
|
|
10
|
+
* Supported message types.
|
|
10
11
|
*/
|
|
11
12
|
export type MessageType = 'text' | 'image' | 'video' | 'audio' | 'location' | 'poll';
|
|
12
13
|
/**
|
|
13
14
|
* @description Estados de un mensaje.
|
|
15
|
+
* Message delivery statuses.
|
|
14
16
|
*/
|
|
15
17
|
export declare enum MESSAGE_STATUS {
|
|
16
|
-
/** Error al enviar */
|
|
18
|
+
/** Error al enviar / Send error */
|
|
17
19
|
ERROR = 0,
|
|
18
|
-
/** Mensaje pendiente de envío */
|
|
20
|
+
/** Mensaje pendiente de envío / Pending send */
|
|
19
21
|
PENDING = 1,
|
|
20
|
-
/** Servidor recibió el mensaje */
|
|
22
|
+
/** Servidor recibió el mensaje / Server acknowledged */
|
|
21
23
|
SERVER_ACK = 2,
|
|
22
|
-
/** Mensaje entregado al destinatario */
|
|
24
|
+
/** Mensaje entregado al destinatario / Delivered */
|
|
23
25
|
DELIVERED = 3,
|
|
24
|
-
/** Mensaje leído por el destinatario */
|
|
26
|
+
/** Mensaje leído por el destinatario / Read */
|
|
25
27
|
READ = 4,
|
|
26
|
-
/** Mensaje reproducido (audio/video) */
|
|
28
|
+
/** Mensaje reproducido (audio/video) / Played */
|
|
27
29
|
PLAYED = 5
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* @description Opciones para crear encuesta.
|
|
33
|
+
* Poll creation options.
|
|
31
34
|
*/
|
|
32
35
|
export interface PollOptions {
|
|
33
|
-
/** Pregunta o título de la encuesta */
|
|
36
|
+
/** Pregunta o título de la encuesta / Poll question or title */
|
|
34
37
|
content: string;
|
|
35
|
-
/** Opciones de respuesta */
|
|
38
|
+
/** Opciones de respuesta / Answer options */
|
|
36
39
|
options: Array<{
|
|
37
40
|
content: string;
|
|
38
41
|
}>;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* @description Opciones para enviar ubicación.
|
|
45
|
+
* Location send options.
|
|
42
46
|
*/
|
|
43
47
|
export interface LocationOptions {
|
|
44
|
-
/** Latitud en grados */
|
|
48
|
+
/** Latitud en grados / Latitude in degrees */
|
|
45
49
|
lat: number;
|
|
46
|
-
/** Longitud en grados */
|
|
50
|
+
/** Longitud en grados / Longitude in degrees */
|
|
47
51
|
lng: number;
|
|
48
|
-
/** true para ubicación en tiempo real */
|
|
52
|
+
/** true para ubicación en tiempo real / true for live location */
|
|
49
53
|
live?: boolean;
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* @description Datos del índice de mensaje (sin content ni raw completo).
|
|
57
|
+
* Message index data (without content or full raw).
|
|
53
58
|
*/
|
|
54
59
|
export interface IMessageIndex {
|
|
55
|
-
/** ID único del mensaje */
|
|
60
|
+
/** ID único del mensaje / Unique message ID */
|
|
56
61
|
id: string;
|
|
57
|
-
/** ID del chat */
|
|
62
|
+
/** ID del chat / Chat ID */
|
|
58
63
|
cid: string;
|
|
59
|
-
/** ID del mensaje padre (reply) */
|
|
64
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
60
65
|
mid: string | null;
|
|
61
|
-
/** Si el mensaje es propio */
|
|
66
|
+
/** Si el mensaje es propio / Whether the message is own */
|
|
62
67
|
me: boolean;
|
|
63
|
-
/** Tipo de mensaje */
|
|
68
|
+
/** Tipo de mensaje / Message type */
|
|
64
69
|
type: MessageType;
|
|
65
|
-
/** Autor del mensaje */
|
|
70
|
+
/** Autor del mensaje / Message author */
|
|
66
71
|
author: string;
|
|
67
|
-
/** Estado de entrega */
|
|
72
|
+
/** Estado de entrega / Delivery status */
|
|
68
73
|
status: MESSAGE_STATUS;
|
|
69
|
-
/** Si está destacado */
|
|
74
|
+
/** Si está destacado / Whether it's starred */
|
|
70
75
|
starred: boolean;
|
|
71
|
-
/** Si fue reenviado */
|
|
76
|
+
/** Si fue reenviado / Whether it was forwarded */
|
|
72
77
|
forwarded: boolean;
|
|
73
|
-
/** Timestamp de creación (ms) */
|
|
78
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
74
79
|
created_at: number;
|
|
75
|
-
/** Timestamp de expiración (ms) o null */
|
|
80
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
76
81
|
deleted_at: number | null;
|
|
77
|
-
/** Tipo MIME */
|
|
82
|
+
/** Tipo MIME / MIME type */
|
|
78
83
|
mime: string;
|
|
79
|
-
/** Caption del mensaje */
|
|
84
|
+
/** Caption del mensaje / Message caption */
|
|
80
85
|
caption: string;
|
|
81
|
-
/** true si fue editado */
|
|
86
|
+
/** true si fue editado / true if edited */
|
|
82
87
|
edited: boolean;
|
|
83
88
|
}
|
|
84
89
|
/**
|
|
85
90
|
* @description Datos completos del mensaje.
|
|
91
|
+
* Full message data.
|
|
86
92
|
*/
|
|
87
93
|
export interface IMessage {
|
|
88
|
-
/** Índice del mensaje */
|
|
94
|
+
/** Índice del mensaje / Message index */
|
|
89
95
|
index: IMessageIndex;
|
|
90
|
-
/** WAMessage raw del protocolo */
|
|
96
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
91
97
|
raw: WAMessage;
|
|
92
98
|
}
|
|
93
99
|
/**
|
|
94
100
|
* @description Mapeo de tipos de contenido de Baileys a MessageType.
|
|
101
|
+
* Baileys content type to MessageType mapping.
|
|
95
102
|
*/
|
|
96
103
|
export declare const MESSAGE_TYPE_MAP: Record<string, MessageType>;
|
|
97
104
|
/**
|
|
98
105
|
* @description Construye IMessageIndex desde WAMessage.
|
|
99
|
-
*
|
|
100
|
-
* @param edited Si el mensaje fue editado.
|
|
101
|
-
* @returns IMessageIndex normalizado.
|
|
106
|
+
* Builds IMessageIndex from WAMessage.
|
|
102
107
|
*/
|
|
103
|
-
|
|
108
|
+
declare function build_message_index(raw: WAMessage, edited?: boolean): IMessageIndex;
|
|
104
109
|
/**
|
|
105
110
|
* @description
|
|
106
111
|
* Clase base para representar un mensaje de WhatsApp.
|
|
107
|
-
*
|
|
112
|
+
* Base class representing a WhatsApp message.
|
|
108
113
|
*/
|
|
109
114
|
export declare class Message {
|
|
110
|
-
/** Índice del mensaje */
|
|
115
|
+
/** Índice del mensaje / Message index */
|
|
111
116
|
readonly index: IMessageIndex;
|
|
112
|
-
/** WAMessage raw del protocolo */
|
|
117
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
113
118
|
readonly raw: WAMessage;
|
|
114
119
|
constructor(data: IMessage);
|
|
115
|
-
/** ID único del mensaje */
|
|
120
|
+
/** ID único del mensaje / Unique message ID */
|
|
116
121
|
get id(): string;
|
|
117
|
-
/** JID del chat al que pertenece */
|
|
122
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
118
123
|
get cid(): string;
|
|
119
|
-
/** ID del mensaje padre (reply) */
|
|
124
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
120
125
|
get mid(): string | null;
|
|
121
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
126
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
122
127
|
get me(): boolean;
|
|
123
|
-
/** Autor del mensaje */
|
|
128
|
+
/** Autor del mensaje / Message author */
|
|
124
129
|
get author(): string;
|
|
125
|
-
/** true si el mensaje fue editado */
|
|
130
|
+
/** true si el mensaje fue editado / true if edited */
|
|
126
131
|
get edited(): boolean;
|
|
127
|
-
/** Tipo de contenido del mensaje */
|
|
132
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
128
133
|
get type(): MessageType;
|
|
129
|
-
/** Texto o caption del mensaje */
|
|
134
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
130
135
|
get caption(): string;
|
|
131
|
-
/** Tipo MIME del contenido */
|
|
136
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
132
137
|
get mime(): string;
|
|
133
|
-
/** Estado del mensaje */
|
|
138
|
+
/** Estado del mensaje / Message status */
|
|
134
139
|
get status(): MESSAGE_STATUS;
|
|
135
|
-
/** true si el mensaje está destacado */
|
|
140
|
+
/** true si el mensaje está destacado / true if starred */
|
|
136
141
|
get starred(): boolean;
|
|
137
|
-
/** true si el mensaje fue reenviado */
|
|
142
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
138
143
|
get forwarded(): boolean;
|
|
139
|
-
/** Timestamp de creación (ms) */
|
|
144
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
140
145
|
get created_at(): number;
|
|
141
|
-
/** Timestamp de expiración (ms) o null */
|
|
146
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
142
147
|
get deleted_at(): number | null;
|
|
143
148
|
/**
|
|
144
149
|
* @description Obtiene el contenido como Readable stream.
|
|
145
|
-
*
|
|
150
|
+
* Gets content as Readable stream.
|
|
146
151
|
*/
|
|
147
152
|
stream(): Promise<Readable>;
|
|
148
153
|
/**
|
|
149
154
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
150
|
-
*
|
|
155
|
+
* Gets message content as Buffer.
|
|
151
156
|
*/
|
|
152
157
|
content(): Promise<Buffer>;
|
|
153
158
|
}
|
|
154
159
|
/**
|
|
155
160
|
* @description Factory que retorna la clase Message enlazada al contexto.
|
|
161
|
+
* Factory that returns the Message class bound to context.
|
|
156
162
|
* @param wa Instancia de WhatsApp.
|
|
157
|
-
* @returns Clase _Message que extiende Message.
|
|
158
163
|
*/
|
|
159
164
|
export declare function message(wa: WhatsApp): {
|
|
160
165
|
new (data: IMessage): {
|
|
166
|
+
/**
|
|
167
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
168
|
+
* Edits the message (text or caption only, own messages only).
|
|
169
|
+
*/
|
|
170
|
+
edit(text: string): Promise<boolean>;
|
|
171
|
+
/**
|
|
172
|
+
* @description Elimina el mensaje para todos.
|
|
173
|
+
* Deletes the message for everyone.
|
|
174
|
+
*/
|
|
175
|
+
remove(): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* @description Reenvía el mensaje a otro chat.
|
|
178
|
+
* Forwards the message to another chat.
|
|
179
|
+
*/
|
|
180
|
+
forward(to_cid: string): Promise<boolean>;
|
|
181
|
+
/**
|
|
182
|
+
* @description Reacciona al mensaje.
|
|
183
|
+
* Reacts to the message.
|
|
184
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
185
|
+
*/
|
|
186
|
+
react(emoji: string): Promise<boolean>;
|
|
187
|
+
/**
|
|
188
|
+
* @description Responde con un mensaje de texto.
|
|
189
|
+
* Replies with a text message.
|
|
190
|
+
*/
|
|
191
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
192
|
+
/**
|
|
193
|
+
* @description Responde con una imagen.
|
|
194
|
+
* Replies with an image.
|
|
195
|
+
*/
|
|
196
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
197
|
+
/**
|
|
198
|
+
* @description Responde con un video.
|
|
199
|
+
* Replies with a video.
|
|
200
|
+
*/
|
|
201
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
202
|
+
/**
|
|
203
|
+
* @description Responde con un audio.
|
|
204
|
+
* Replies with an audio.
|
|
205
|
+
*/
|
|
206
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
207
|
+
/**
|
|
208
|
+
* @description Responde con una ubicacion.
|
|
209
|
+
* Replies with a location.
|
|
210
|
+
*/
|
|
211
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
212
|
+
/**
|
|
213
|
+
* @description Responde con una encuesta.
|
|
214
|
+
* Replies with a poll.
|
|
215
|
+
*/
|
|
216
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
161
217
|
/**
|
|
162
218
|
* @description Obtiene el contenido como Readable stream.
|
|
163
|
-
*
|
|
164
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
165
|
-
* @returns Readable stream con el contenido.
|
|
219
|
+
* Gets content as Readable stream.
|
|
166
220
|
*/
|
|
167
221
|
stream(): Promise<Readable>;
|
|
168
222
|
/**
|
|
169
223
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
170
|
-
*
|
|
171
|
-
* @returns Buffer con el contenido.
|
|
224
|
+
* Gets message content as Buffer.
|
|
172
225
|
*/
|
|
173
226
|
content(): Promise<Buffer>;
|
|
174
|
-
/** Índice del mensaje */
|
|
227
|
+
/** Índice del mensaje / Message index */
|
|
175
228
|
readonly index: IMessageIndex;
|
|
176
|
-
/** WAMessage raw del protocolo */
|
|
229
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
177
230
|
readonly raw: WAMessage;
|
|
178
|
-
/** ID único del mensaje */
|
|
231
|
+
/** ID único del mensaje / Unique message ID */
|
|
179
232
|
get id(): string;
|
|
180
|
-
/** JID del chat al que pertenece */
|
|
233
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
181
234
|
get cid(): string;
|
|
182
|
-
/** ID del mensaje padre (reply) */
|
|
235
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
183
236
|
get mid(): string | null;
|
|
184
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
237
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
185
238
|
get me(): boolean;
|
|
186
|
-
/** Autor del mensaje */
|
|
239
|
+
/** Autor del mensaje / Message author */
|
|
187
240
|
get author(): string;
|
|
188
|
-
/** true si el mensaje fue editado */
|
|
241
|
+
/** true si el mensaje fue editado / true if edited */
|
|
189
242
|
get edited(): boolean;
|
|
190
|
-
/** Tipo de contenido del mensaje */
|
|
243
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
191
244
|
get type(): MessageType;
|
|
192
|
-
/** Texto o caption del mensaje */
|
|
245
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
193
246
|
get caption(): string;
|
|
194
|
-
/** Tipo MIME del contenido */
|
|
247
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
195
248
|
get mime(): string;
|
|
196
|
-
/** Estado del mensaje */
|
|
249
|
+
/** Estado del mensaje / Message status */
|
|
197
250
|
get status(): MESSAGE_STATUS;
|
|
198
|
-
/** true si el mensaje está destacado */
|
|
251
|
+
/** true si el mensaje está destacado / true if starred */
|
|
199
252
|
get starred(): boolean;
|
|
200
|
-
/** true si el mensaje fue reenviado */
|
|
253
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
201
254
|
get forwarded(): boolean;
|
|
202
|
-
/** Timestamp de creación (ms) */
|
|
255
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
203
256
|
get created_at(): number;
|
|
204
|
-
/** Timestamp de expiración (ms) o null */
|
|
257
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
205
258
|
get deleted_at(): number | null;
|
|
206
259
|
};
|
|
207
260
|
/**
|
|
208
261
|
* @description Obtiene un mensaje por CID y MID.
|
|
209
|
-
*
|
|
210
|
-
* @param mid ID del mensaje.
|
|
211
|
-
* @returns Mensaje o null si no existe.
|
|
262
|
+
* Retrieves a message by CID and MID.
|
|
212
263
|
*/
|
|
213
264
|
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
214
265
|
/**
|
|
215
|
-
* @description
|
|
216
|
-
*
|
|
217
|
-
* @param mid ID del mensaje.
|
|
218
|
-
* @param emoji Emoji de reacción (vacío para quitar).
|
|
219
|
-
* @returns true si se envió correctamente.
|
|
220
|
-
*/
|
|
221
|
-
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
222
|
-
/**
|
|
223
|
-
* @description Elimina un mensaje para todos.
|
|
224
|
-
* @param cid ID del chat.
|
|
225
|
-
* @param mid ID del mensaje.
|
|
226
|
-
* @returns true si se eliminó correctamente.
|
|
227
|
-
*/
|
|
228
|
-
remove(cid: string, mid: string): Promise<boolean>;
|
|
229
|
-
/**
|
|
230
|
-
* @description Reenvía un mensaje a otro chat.
|
|
231
|
-
* @param cid ID del chat origen.
|
|
232
|
-
* @param mid ID del mensaje.
|
|
233
|
-
* @param to_cid ID del chat destino.
|
|
234
|
-
* @returns true si se reenvió correctamente.
|
|
266
|
+
* @description Lista mensajes de un chat (paginado).
|
|
267
|
+
* Lists messages from a chat (paginated).
|
|
235
268
|
*/
|
|
236
|
-
|
|
269
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
237
270
|
/**
|
|
238
|
-
* @description
|
|
239
|
-
*
|
|
240
|
-
* @param mid ID del mensaje.
|
|
241
|
-
* @param text Nuevo contenido.
|
|
242
|
-
* @returns true si se editó correctamente.
|
|
271
|
+
* @description Cuenta mensajes de un chat.
|
|
272
|
+
* Counts messages in a chat.
|
|
243
273
|
*/
|
|
244
|
-
|
|
274
|
+
count(cid: string): Promise<number>;
|
|
245
275
|
/**
|
|
246
276
|
* @description Envía un mensaje de texto.
|
|
247
|
-
*
|
|
248
|
-
* @param text Contenido del mensaje.
|
|
249
|
-
* @returns Mensaje enviado o null.
|
|
277
|
+
* Sends a text message.
|
|
250
278
|
*/
|
|
251
|
-
text(cid: string, text: string): Promise<{
|
|
279
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
280
|
+
/**
|
|
281
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
282
|
+
* Edits the message (text or caption only, own messages only).
|
|
283
|
+
*/
|
|
284
|
+
edit(text: string): Promise<boolean>;
|
|
285
|
+
/**
|
|
286
|
+
* @description Elimina el mensaje para todos.
|
|
287
|
+
* Deletes the message for everyone.
|
|
288
|
+
*/
|
|
289
|
+
remove(): Promise<boolean>;
|
|
290
|
+
/**
|
|
291
|
+
* @description Reenvía el mensaje a otro chat.
|
|
292
|
+
* Forwards the message to another chat.
|
|
293
|
+
*/
|
|
294
|
+
forward(to_cid: string): Promise<boolean>;
|
|
295
|
+
/**
|
|
296
|
+
* @description Reacciona al mensaje.
|
|
297
|
+
* Reacts to the message.
|
|
298
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
299
|
+
*/
|
|
300
|
+
react(emoji: string): Promise<boolean>;
|
|
301
|
+
/**
|
|
302
|
+
* @description Responde con un mensaje de texto.
|
|
303
|
+
* Replies with a text message.
|
|
304
|
+
*/
|
|
305
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
306
|
+
/**
|
|
307
|
+
* @description Responde con una imagen.
|
|
308
|
+
* Replies with an image.
|
|
309
|
+
*/
|
|
310
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
311
|
+
/**
|
|
312
|
+
* @description Responde con un video.
|
|
313
|
+
* Replies with a video.
|
|
314
|
+
*/
|
|
315
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
316
|
+
/**
|
|
317
|
+
* @description Responde con un audio.
|
|
318
|
+
* Replies with an audio.
|
|
319
|
+
*/
|
|
320
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
321
|
+
/**
|
|
322
|
+
* @description Responde con una ubicacion.
|
|
323
|
+
* Replies with a location.
|
|
324
|
+
*/
|
|
325
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
326
|
+
/**
|
|
327
|
+
* @description Responde con una encuesta.
|
|
328
|
+
* Replies with a poll.
|
|
329
|
+
*/
|
|
330
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
252
331
|
/**
|
|
253
332
|
* @description Obtiene el contenido como Readable stream.
|
|
254
|
-
*
|
|
255
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
256
|
-
* @returns Readable stream con el contenido.
|
|
333
|
+
* Gets content as Readable stream.
|
|
257
334
|
*/
|
|
258
335
|
stream(): Promise<Readable>;
|
|
259
336
|
/**
|
|
260
337
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
261
|
-
*
|
|
262
|
-
* @returns Buffer con el contenido.
|
|
338
|
+
* Gets message content as Buffer.
|
|
263
339
|
*/
|
|
264
340
|
content(): Promise<Buffer>;
|
|
265
|
-
/** Índice del mensaje */
|
|
341
|
+
/** Índice del mensaje / Message index */
|
|
266
342
|
readonly index: IMessageIndex;
|
|
267
|
-
/** WAMessage raw del protocolo */
|
|
343
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
268
344
|
readonly raw: WAMessage;
|
|
269
|
-
/** ID único del mensaje */
|
|
345
|
+
/** ID único del mensaje / Unique message ID */
|
|
270
346
|
get id(): string;
|
|
271
|
-
/** JID del chat al que pertenece */
|
|
347
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
272
348
|
get cid(): string;
|
|
273
|
-
/** ID del mensaje padre (reply) */
|
|
349
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
274
350
|
get mid(): string | null;
|
|
275
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
351
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
276
352
|
get me(): boolean;
|
|
277
|
-
/** Autor del mensaje */
|
|
353
|
+
/** Autor del mensaje / Message author */
|
|
278
354
|
get author(): string;
|
|
279
|
-
/** true si el mensaje fue editado */
|
|
355
|
+
/** true si el mensaje fue editado / true if edited */
|
|
280
356
|
get edited(): boolean;
|
|
281
|
-
/** Tipo de contenido del mensaje */
|
|
357
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
282
358
|
get type(): MessageType;
|
|
283
|
-
/** Texto o caption del mensaje */
|
|
359
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
284
360
|
get caption(): string;
|
|
285
|
-
/** Tipo MIME del contenido */
|
|
361
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
286
362
|
get mime(): string;
|
|
287
|
-
/** Estado del mensaje */
|
|
363
|
+
/** Estado del mensaje / Message status */
|
|
288
364
|
get status(): MESSAGE_STATUS;
|
|
289
|
-
/** true si el mensaje está destacado */
|
|
365
|
+
/** true si el mensaje está destacado / true if starred */
|
|
290
366
|
get starred(): boolean;
|
|
291
|
-
/** true si el mensaje fue reenviado */
|
|
367
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
292
368
|
get forwarded(): boolean;
|
|
293
|
-
/** Timestamp de creación (ms) */
|
|
369
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
294
370
|
get created_at(): number;
|
|
295
|
-
/** Timestamp de expiración (ms) o null */
|
|
371
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
296
372
|
get deleted_at(): number | null;
|
|
297
373
|
} | null>;
|
|
298
374
|
/**
|
|
299
375
|
* @description Envía una imagen.
|
|
300
|
-
*
|
|
301
|
-
* @param buffer Buffer de la imagen.
|
|
302
|
-
* @param caption Caption opcional.
|
|
303
|
-
* @returns Mensaje enviado o null.
|
|
376
|
+
* Sends an image.
|
|
304
377
|
*/
|
|
305
|
-
image(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
378
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
379
|
+
/**
|
|
380
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
381
|
+
* Edits the message (text or caption only, own messages only).
|
|
382
|
+
*/
|
|
383
|
+
edit(text: string): Promise<boolean>;
|
|
384
|
+
/**
|
|
385
|
+
* @description Elimina el mensaje para todos.
|
|
386
|
+
* Deletes the message for everyone.
|
|
387
|
+
*/
|
|
388
|
+
remove(): Promise<boolean>;
|
|
389
|
+
/**
|
|
390
|
+
* @description Reenvía el mensaje a otro chat.
|
|
391
|
+
* Forwards the message to another chat.
|
|
392
|
+
*/
|
|
393
|
+
forward(to_cid: string): Promise<boolean>;
|
|
394
|
+
/**
|
|
395
|
+
* @description Reacciona al mensaje.
|
|
396
|
+
* Reacts to the message.
|
|
397
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
398
|
+
*/
|
|
399
|
+
react(emoji: string): Promise<boolean>;
|
|
400
|
+
/**
|
|
401
|
+
* @description Responde con un mensaje de texto.
|
|
402
|
+
* Replies with a text message.
|
|
403
|
+
*/
|
|
404
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
405
|
+
/**
|
|
406
|
+
* @description Responde con una imagen.
|
|
407
|
+
* Replies with an image.
|
|
408
|
+
*/
|
|
409
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
410
|
+
/**
|
|
411
|
+
* @description Responde con un video.
|
|
412
|
+
* Replies with a video.
|
|
413
|
+
*/
|
|
414
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
415
|
+
/**
|
|
416
|
+
* @description Responde con un audio.
|
|
417
|
+
* Replies with an audio.
|
|
418
|
+
*/
|
|
419
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
420
|
+
/**
|
|
421
|
+
* @description Responde con una ubicacion.
|
|
422
|
+
* Replies with a location.
|
|
423
|
+
*/
|
|
424
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
425
|
+
/**
|
|
426
|
+
* @description Responde con una encuesta.
|
|
427
|
+
* Replies with a poll.
|
|
428
|
+
*/
|
|
429
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
306
430
|
/**
|
|
307
431
|
* @description Obtiene el contenido como Readable stream.
|
|
308
|
-
*
|
|
309
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
310
|
-
* @returns Readable stream con el contenido.
|
|
432
|
+
* Gets content as Readable stream.
|
|
311
433
|
*/
|
|
312
434
|
stream(): Promise<Readable>;
|
|
313
435
|
/**
|
|
314
436
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
315
|
-
*
|
|
316
|
-
* @returns Buffer con el contenido.
|
|
437
|
+
* Gets message content as Buffer.
|
|
317
438
|
*/
|
|
318
439
|
content(): Promise<Buffer>;
|
|
319
|
-
/** Índice del mensaje */
|
|
440
|
+
/** Índice del mensaje / Message index */
|
|
320
441
|
readonly index: IMessageIndex;
|
|
321
|
-
/** WAMessage raw del protocolo */
|
|
442
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
322
443
|
readonly raw: WAMessage;
|
|
323
|
-
/** ID único del mensaje */
|
|
444
|
+
/** ID único del mensaje / Unique message ID */
|
|
324
445
|
get id(): string;
|
|
325
|
-
/** JID del chat al que pertenece */
|
|
446
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
326
447
|
get cid(): string;
|
|
327
|
-
/** ID del mensaje padre (reply) */
|
|
448
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
328
449
|
get mid(): string | null;
|
|
329
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
450
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
330
451
|
get me(): boolean;
|
|
331
|
-
/** Autor del mensaje */
|
|
452
|
+
/** Autor del mensaje / Message author */
|
|
332
453
|
get author(): string;
|
|
333
|
-
/** true si el mensaje fue editado */
|
|
454
|
+
/** true si el mensaje fue editado / true if edited */
|
|
334
455
|
get edited(): boolean;
|
|
335
|
-
/** Tipo de contenido del mensaje */
|
|
456
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
336
457
|
get type(): MessageType;
|
|
337
|
-
/** Texto o caption del mensaje */
|
|
458
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
338
459
|
get caption(): string;
|
|
339
|
-
/** Tipo MIME del contenido */
|
|
460
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
340
461
|
get mime(): string;
|
|
341
|
-
/** Estado del mensaje */
|
|
462
|
+
/** Estado del mensaje / Message status */
|
|
342
463
|
get status(): MESSAGE_STATUS;
|
|
343
|
-
/** true si el mensaje está destacado */
|
|
464
|
+
/** true si el mensaje está destacado / true if starred */
|
|
344
465
|
get starred(): boolean;
|
|
345
|
-
/** true si el mensaje fue reenviado */
|
|
466
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
346
467
|
get forwarded(): boolean;
|
|
347
|
-
/** Timestamp de creación (ms) */
|
|
468
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
348
469
|
get created_at(): number;
|
|
349
|
-
/** Timestamp de expiración (ms) o null */
|
|
470
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
350
471
|
get deleted_at(): number | null;
|
|
351
472
|
} | null>;
|
|
352
473
|
/**
|
|
353
474
|
* @description Envía un video.
|
|
354
|
-
*
|
|
355
|
-
* @param buffer Buffer del video.
|
|
356
|
-
* @param caption Caption opcional.
|
|
357
|
-
* @returns Mensaje enviado o null.
|
|
475
|
+
* Sends a video.
|
|
358
476
|
*/
|
|
359
|
-
video(cid: string, buffer: Buffer, caption?: string): Promise<{
|
|
477
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
478
|
+
/**
|
|
479
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
480
|
+
* Edits the message (text or caption only, own messages only).
|
|
481
|
+
*/
|
|
482
|
+
edit(text: string): Promise<boolean>;
|
|
483
|
+
/**
|
|
484
|
+
* @description Elimina el mensaje para todos.
|
|
485
|
+
* Deletes the message for everyone.
|
|
486
|
+
*/
|
|
487
|
+
remove(): Promise<boolean>;
|
|
488
|
+
/**
|
|
489
|
+
* @description Reenvía el mensaje a otro chat.
|
|
490
|
+
* Forwards the message to another chat.
|
|
491
|
+
*/
|
|
492
|
+
forward(to_cid: string): Promise<boolean>;
|
|
493
|
+
/**
|
|
494
|
+
* @description Reacciona al mensaje.
|
|
495
|
+
* Reacts to the message.
|
|
496
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
497
|
+
*/
|
|
498
|
+
react(emoji: string): Promise<boolean>;
|
|
499
|
+
/**
|
|
500
|
+
* @description Responde con un mensaje de texto.
|
|
501
|
+
* Replies with a text message.
|
|
502
|
+
*/
|
|
503
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
504
|
+
/**
|
|
505
|
+
* @description Responde con una imagen.
|
|
506
|
+
* Replies with an image.
|
|
507
|
+
*/
|
|
508
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
509
|
+
/**
|
|
510
|
+
* @description Responde con un video.
|
|
511
|
+
* Replies with a video.
|
|
512
|
+
*/
|
|
513
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
514
|
+
/**
|
|
515
|
+
* @description Responde con un audio.
|
|
516
|
+
* Replies with an audio.
|
|
517
|
+
*/
|
|
518
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
519
|
+
/**
|
|
520
|
+
* @description Responde con una ubicacion.
|
|
521
|
+
* Replies with a location.
|
|
522
|
+
*/
|
|
523
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
524
|
+
/**
|
|
525
|
+
* @description Responde con una encuesta.
|
|
526
|
+
* Replies with a poll.
|
|
527
|
+
*/
|
|
528
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
360
529
|
/**
|
|
361
530
|
* @description Obtiene el contenido como Readable stream.
|
|
362
|
-
*
|
|
363
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
364
|
-
* @returns Readable stream con el contenido.
|
|
531
|
+
* Gets content as Readable stream.
|
|
365
532
|
*/
|
|
366
533
|
stream(): Promise<Readable>;
|
|
367
534
|
/**
|
|
368
535
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
369
|
-
*
|
|
370
|
-
* @returns Buffer con el contenido.
|
|
536
|
+
* Gets message content as Buffer.
|
|
371
537
|
*/
|
|
372
538
|
content(): Promise<Buffer>;
|
|
373
|
-
/** Índice del mensaje */
|
|
539
|
+
/** Índice del mensaje / Message index */
|
|
374
540
|
readonly index: IMessageIndex;
|
|
375
|
-
/** WAMessage raw del protocolo */
|
|
541
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
376
542
|
readonly raw: WAMessage;
|
|
377
|
-
/** ID único del mensaje */
|
|
543
|
+
/** ID único del mensaje / Unique message ID */
|
|
378
544
|
get id(): string;
|
|
379
|
-
/** JID del chat al que pertenece */
|
|
545
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
380
546
|
get cid(): string;
|
|
381
|
-
/** ID del mensaje padre (reply) */
|
|
547
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
382
548
|
get mid(): string | null;
|
|
383
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
549
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
384
550
|
get me(): boolean;
|
|
385
|
-
/** Autor del mensaje */
|
|
551
|
+
/** Autor del mensaje / Message author */
|
|
386
552
|
get author(): string;
|
|
387
|
-
/** true si el mensaje fue editado */
|
|
553
|
+
/** true si el mensaje fue editado / true if edited */
|
|
388
554
|
get edited(): boolean;
|
|
389
|
-
/** Tipo de contenido del mensaje */
|
|
555
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
390
556
|
get type(): MessageType;
|
|
391
|
-
/** Texto o caption del mensaje */
|
|
557
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
392
558
|
get caption(): string;
|
|
393
|
-
/** Tipo MIME del contenido */
|
|
559
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
394
560
|
get mime(): string;
|
|
395
|
-
/** Estado del mensaje */
|
|
561
|
+
/** Estado del mensaje / Message status */
|
|
396
562
|
get status(): MESSAGE_STATUS;
|
|
397
|
-
/** true si el mensaje está destacado */
|
|
563
|
+
/** true si el mensaje está destacado / true if starred */
|
|
398
564
|
get starred(): boolean;
|
|
399
|
-
/** true si el mensaje fue reenviado */
|
|
565
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
400
566
|
get forwarded(): boolean;
|
|
401
|
-
/** Timestamp de creación (ms) */
|
|
567
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
402
568
|
get created_at(): number;
|
|
403
|
-
/** Timestamp de expiración (ms) o null */
|
|
569
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
404
570
|
get deleted_at(): number | null;
|
|
405
571
|
} | null>;
|
|
406
572
|
/**
|
|
407
573
|
* @description Envía un audio.
|
|
408
|
-
*
|
|
409
|
-
* @param
|
|
410
|
-
* @param ptt true para nota de voz (default true).
|
|
411
|
-
* @returns Mensaje enviado o null.
|
|
574
|
+
* Sends an audio.
|
|
575
|
+
* @param ptt true para nota de voz (default true) / true for voice note (default true).
|
|
412
576
|
*/
|
|
413
|
-
audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
|
|
577
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
578
|
+
/**
|
|
579
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
580
|
+
* Edits the message (text or caption only, own messages only).
|
|
581
|
+
*/
|
|
582
|
+
edit(text: string): Promise<boolean>;
|
|
583
|
+
/**
|
|
584
|
+
* @description Elimina el mensaje para todos.
|
|
585
|
+
* Deletes the message for everyone.
|
|
586
|
+
*/
|
|
587
|
+
remove(): Promise<boolean>;
|
|
588
|
+
/**
|
|
589
|
+
* @description Reenvía el mensaje a otro chat.
|
|
590
|
+
* Forwards the message to another chat.
|
|
591
|
+
*/
|
|
592
|
+
forward(to_cid: string): Promise<boolean>;
|
|
593
|
+
/**
|
|
594
|
+
* @description Reacciona al mensaje.
|
|
595
|
+
* Reacts to the message.
|
|
596
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
597
|
+
*/
|
|
598
|
+
react(emoji: string): Promise<boolean>;
|
|
599
|
+
/**
|
|
600
|
+
* @description Responde con un mensaje de texto.
|
|
601
|
+
* Replies with a text message.
|
|
602
|
+
*/
|
|
603
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
604
|
+
/**
|
|
605
|
+
* @description Responde con una imagen.
|
|
606
|
+
* Replies with an image.
|
|
607
|
+
*/
|
|
608
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
609
|
+
/**
|
|
610
|
+
* @description Responde con un video.
|
|
611
|
+
* Replies with a video.
|
|
612
|
+
*/
|
|
613
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
614
|
+
/**
|
|
615
|
+
* @description Responde con un audio.
|
|
616
|
+
* Replies with an audio.
|
|
617
|
+
*/
|
|
618
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
619
|
+
/**
|
|
620
|
+
* @description Responde con una ubicacion.
|
|
621
|
+
* Replies with a location.
|
|
622
|
+
*/
|
|
623
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
624
|
+
/**
|
|
625
|
+
* @description Responde con una encuesta.
|
|
626
|
+
* Replies with a poll.
|
|
627
|
+
*/
|
|
628
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
414
629
|
/**
|
|
415
630
|
* @description Obtiene el contenido como Readable stream.
|
|
416
|
-
*
|
|
417
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
418
|
-
* @returns Readable stream con el contenido.
|
|
631
|
+
* Gets content as Readable stream.
|
|
419
632
|
*/
|
|
420
633
|
stream(): Promise<Readable>;
|
|
421
634
|
/**
|
|
422
635
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
423
|
-
*
|
|
424
|
-
* @returns Buffer con el contenido.
|
|
636
|
+
* Gets message content as Buffer.
|
|
425
637
|
*/
|
|
426
638
|
content(): Promise<Buffer>;
|
|
427
|
-
/** Índice del mensaje */
|
|
639
|
+
/** Índice del mensaje / Message index */
|
|
428
640
|
readonly index: IMessageIndex;
|
|
429
|
-
/** WAMessage raw del protocolo */
|
|
641
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
430
642
|
readonly raw: WAMessage;
|
|
431
|
-
/** ID único del mensaje */
|
|
643
|
+
/** ID único del mensaje / Unique message ID */
|
|
432
644
|
get id(): string;
|
|
433
|
-
/** JID del chat al que pertenece */
|
|
645
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
434
646
|
get cid(): string;
|
|
435
|
-
/** ID del mensaje padre (reply) */
|
|
647
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
436
648
|
get mid(): string | null;
|
|
437
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
649
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
438
650
|
get me(): boolean;
|
|
439
|
-
/** Autor del mensaje */
|
|
651
|
+
/** Autor del mensaje / Message author */
|
|
440
652
|
get author(): string;
|
|
441
|
-
/** true si el mensaje fue editado */
|
|
653
|
+
/** true si el mensaje fue editado / true if edited */
|
|
442
654
|
get edited(): boolean;
|
|
443
|
-
/** Tipo de contenido del mensaje */
|
|
655
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
444
656
|
get type(): MessageType;
|
|
445
|
-
/** Texto o caption del mensaje */
|
|
657
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
446
658
|
get caption(): string;
|
|
447
|
-
/** Tipo MIME del contenido */
|
|
659
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
448
660
|
get mime(): string;
|
|
449
|
-
/** Estado del mensaje */
|
|
661
|
+
/** Estado del mensaje / Message status */
|
|
450
662
|
get status(): MESSAGE_STATUS;
|
|
451
|
-
/** true si el mensaje está destacado */
|
|
663
|
+
/** true si el mensaje está destacado / true if starred */
|
|
452
664
|
get starred(): boolean;
|
|
453
|
-
/** true si el mensaje fue reenviado */
|
|
665
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
454
666
|
get forwarded(): boolean;
|
|
455
|
-
/** Timestamp de creación (ms) */
|
|
667
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
456
668
|
get created_at(): number;
|
|
457
|
-
/** Timestamp de expiración (ms) o null */
|
|
669
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
458
670
|
get deleted_at(): number | null;
|
|
459
671
|
} | null>;
|
|
460
672
|
/**
|
|
461
673
|
* @description Envía una ubicación.
|
|
462
|
-
*
|
|
463
|
-
* @param opts Opciones de ubicación (lat, lng, live).
|
|
464
|
-
* @returns Mensaje enviado o null.
|
|
674
|
+
* Sends a location.
|
|
465
675
|
*/
|
|
466
|
-
location(cid: string, opts: LocationOptions): Promise<{
|
|
676
|
+
location(cid: string, opts: LocationOptions, mid?: string): Promise<{
|
|
677
|
+
/**
|
|
678
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
679
|
+
* Edits the message (text or caption only, own messages only).
|
|
680
|
+
*/
|
|
681
|
+
edit(text: string): Promise<boolean>;
|
|
682
|
+
/**
|
|
683
|
+
* @description Elimina el mensaje para todos.
|
|
684
|
+
* Deletes the message for everyone.
|
|
685
|
+
*/
|
|
686
|
+
remove(): Promise<boolean>;
|
|
687
|
+
/**
|
|
688
|
+
* @description Reenvía el mensaje a otro chat.
|
|
689
|
+
* Forwards the message to another chat.
|
|
690
|
+
*/
|
|
691
|
+
forward(to_cid: string): Promise<boolean>;
|
|
692
|
+
/**
|
|
693
|
+
* @description Reacciona al mensaje.
|
|
694
|
+
* Reacts to the message.
|
|
695
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
696
|
+
*/
|
|
697
|
+
react(emoji: string): Promise<boolean>;
|
|
698
|
+
/**
|
|
699
|
+
* @description Responde con un mensaje de texto.
|
|
700
|
+
* Replies with a text message.
|
|
701
|
+
*/
|
|
702
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
703
|
+
/**
|
|
704
|
+
* @description Responde con una imagen.
|
|
705
|
+
* Replies with an image.
|
|
706
|
+
*/
|
|
707
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
708
|
+
/**
|
|
709
|
+
* @description Responde con un video.
|
|
710
|
+
* Replies with a video.
|
|
711
|
+
*/
|
|
712
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
713
|
+
/**
|
|
714
|
+
* @description Responde con un audio.
|
|
715
|
+
* Replies with an audio.
|
|
716
|
+
*/
|
|
717
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
718
|
+
/**
|
|
719
|
+
* @description Responde con una ubicacion.
|
|
720
|
+
* Replies with a location.
|
|
721
|
+
*/
|
|
722
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
723
|
+
/**
|
|
724
|
+
* @description Responde con una encuesta.
|
|
725
|
+
* Replies with a poll.
|
|
726
|
+
*/
|
|
727
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
467
728
|
/**
|
|
468
729
|
* @description Obtiene el contenido como Readable stream.
|
|
469
|
-
*
|
|
470
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
471
|
-
* @returns Readable stream con el contenido.
|
|
730
|
+
* Gets content as Readable stream.
|
|
472
731
|
*/
|
|
473
732
|
stream(): Promise<Readable>;
|
|
474
733
|
/**
|
|
475
734
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
476
|
-
*
|
|
477
|
-
* @returns Buffer con el contenido.
|
|
735
|
+
* Gets message content as Buffer.
|
|
478
736
|
*/
|
|
479
737
|
content(): Promise<Buffer>;
|
|
480
|
-
/** Índice del mensaje */
|
|
738
|
+
/** Índice del mensaje / Message index */
|
|
481
739
|
readonly index: IMessageIndex;
|
|
482
|
-
/** WAMessage raw del protocolo */
|
|
740
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
483
741
|
readonly raw: WAMessage;
|
|
484
|
-
/** ID único del mensaje */
|
|
742
|
+
/** ID único del mensaje / Unique message ID */
|
|
485
743
|
get id(): string;
|
|
486
|
-
/** JID del chat al que pertenece */
|
|
744
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
487
745
|
get cid(): string;
|
|
488
|
-
/** ID del mensaje padre (reply) */
|
|
746
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
489
747
|
get mid(): string | null;
|
|
490
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
748
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
491
749
|
get me(): boolean;
|
|
492
|
-
/** Autor del mensaje */
|
|
750
|
+
/** Autor del mensaje / Message author */
|
|
493
751
|
get author(): string;
|
|
494
|
-
/** true si el mensaje fue editado */
|
|
752
|
+
/** true si el mensaje fue editado / true if edited */
|
|
495
753
|
get edited(): boolean;
|
|
496
|
-
/** Tipo de contenido del mensaje */
|
|
754
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
497
755
|
get type(): MessageType;
|
|
498
|
-
/** Texto o caption del mensaje */
|
|
756
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
499
757
|
get caption(): string;
|
|
500
|
-
/** Tipo MIME del contenido */
|
|
758
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
501
759
|
get mime(): string;
|
|
502
|
-
/** Estado del mensaje */
|
|
760
|
+
/** Estado del mensaje / Message status */
|
|
503
761
|
get status(): MESSAGE_STATUS;
|
|
504
|
-
/** true si el mensaje está destacado */
|
|
762
|
+
/** true si el mensaje está destacado / true if starred */
|
|
505
763
|
get starred(): boolean;
|
|
506
|
-
/** true si el mensaje fue reenviado */
|
|
764
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
507
765
|
get forwarded(): boolean;
|
|
508
|
-
/** Timestamp de creación (ms) */
|
|
766
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
509
767
|
get created_at(): number;
|
|
510
|
-
/** Timestamp de expiración (ms) o null */
|
|
768
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
511
769
|
get deleted_at(): number | null;
|
|
512
770
|
} | null>;
|
|
513
771
|
/**
|
|
514
772
|
* @description Envía una encuesta.
|
|
515
|
-
*
|
|
516
|
-
* @param opts Opciones de encuesta (content, options).
|
|
517
|
-
* @returns Mensaje enviado o null.
|
|
773
|
+
* Sends a poll.
|
|
518
774
|
*/
|
|
519
|
-
poll(cid: string, opts: PollOptions): Promise<{
|
|
775
|
+
poll(cid: string, opts: PollOptions, mid?: string): Promise<{
|
|
776
|
+
/**
|
|
777
|
+
* @description Edita el mensaje (solo texto o caption, solo mensajes propios).
|
|
778
|
+
* Edits the message (text or caption only, own messages only).
|
|
779
|
+
*/
|
|
780
|
+
edit(text: string): Promise<boolean>;
|
|
781
|
+
/**
|
|
782
|
+
* @description Elimina el mensaje para todos.
|
|
783
|
+
* Deletes the message for everyone.
|
|
784
|
+
*/
|
|
785
|
+
remove(): Promise<boolean>;
|
|
786
|
+
/**
|
|
787
|
+
* @description Reenvía el mensaje a otro chat.
|
|
788
|
+
* Forwards the message to another chat.
|
|
789
|
+
*/
|
|
790
|
+
forward(to_cid: string): Promise<boolean>;
|
|
791
|
+
/**
|
|
792
|
+
* @description Reacciona al mensaje.
|
|
793
|
+
* Reacts to the message.
|
|
794
|
+
* @param emoji Emoji de reacción (vacío para quitar) / Reaction emoji (empty to remove).
|
|
795
|
+
*/
|
|
796
|
+
react(emoji: string): Promise<boolean>;
|
|
797
|
+
/**
|
|
798
|
+
* @description Responde con un mensaje de texto.
|
|
799
|
+
* Replies with a text message.
|
|
800
|
+
*/
|
|
801
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
802
|
+
/**
|
|
803
|
+
* @description Responde con una imagen.
|
|
804
|
+
* Replies with an image.
|
|
805
|
+
*/
|
|
806
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
807
|
+
/**
|
|
808
|
+
* @description Responde con un video.
|
|
809
|
+
* Replies with a video.
|
|
810
|
+
*/
|
|
811
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
812
|
+
/**
|
|
813
|
+
* @description Responde con un audio.
|
|
814
|
+
* Replies with an audio.
|
|
815
|
+
*/
|
|
816
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
817
|
+
/**
|
|
818
|
+
* @description Responde con una ubicacion.
|
|
819
|
+
* Replies with a location.
|
|
820
|
+
*/
|
|
821
|
+
location(opts: LocationOptions): Promise</*elided*/ any | null>;
|
|
822
|
+
/**
|
|
823
|
+
* @description Responde con una encuesta.
|
|
824
|
+
* Replies with a poll.
|
|
825
|
+
*/
|
|
826
|
+
poll(opts: PollOptions): Promise</*elided*/ any | null>;
|
|
520
827
|
/**
|
|
521
828
|
* @description Obtiene el contenido como Readable stream.
|
|
522
|
-
*
|
|
523
|
-
* Para text/location/poll retorna stream desde buffer pequeño.
|
|
524
|
-
* @returns Readable stream con el contenido.
|
|
829
|
+
* Gets content as Readable stream.
|
|
525
830
|
*/
|
|
526
831
|
stream(): Promise<Readable>;
|
|
527
832
|
/**
|
|
528
833
|
* @description Obtiene el contenido del mensaje como Buffer.
|
|
529
|
-
*
|
|
530
|
-
* @returns Buffer con el contenido.
|
|
834
|
+
* Gets message content as Buffer.
|
|
531
835
|
*/
|
|
532
836
|
content(): Promise<Buffer>;
|
|
533
|
-
/** Índice del mensaje */
|
|
837
|
+
/** Índice del mensaje / Message index */
|
|
534
838
|
readonly index: IMessageIndex;
|
|
535
|
-
/** WAMessage raw del protocolo */
|
|
839
|
+
/** WAMessage raw del protocolo / Protocol raw WAMessage */
|
|
536
840
|
readonly raw: WAMessage;
|
|
537
|
-
/** ID único del mensaje */
|
|
841
|
+
/** ID único del mensaje / Unique message ID */
|
|
538
842
|
get id(): string;
|
|
539
|
-
/** JID del chat al que pertenece */
|
|
843
|
+
/** JID del chat al que pertenece / Chat JID */
|
|
540
844
|
get cid(): string;
|
|
541
|
-
/** ID del mensaje padre (reply) */
|
|
845
|
+
/** ID del mensaje padre (reply) / Parent message ID (reply) */
|
|
542
846
|
get mid(): string | null;
|
|
543
|
-
/** true si el mensaje fue enviado por el usuario autenticado */
|
|
847
|
+
/** true si el mensaje fue enviado por el usuario autenticado / true if sent by authenticated user */
|
|
544
848
|
get me(): boolean;
|
|
545
|
-
/** Autor del mensaje */
|
|
849
|
+
/** Autor del mensaje / Message author */
|
|
546
850
|
get author(): string;
|
|
547
|
-
/** true si el mensaje fue editado */
|
|
851
|
+
/** true si el mensaje fue editado / true if edited */
|
|
548
852
|
get edited(): boolean;
|
|
549
|
-
/** Tipo de contenido del mensaje */
|
|
853
|
+
/** Tipo de contenido del mensaje / Message content type */
|
|
550
854
|
get type(): MessageType;
|
|
551
|
-
/** Texto o caption del mensaje */
|
|
855
|
+
/** Texto o caption del mensaje / Message text or caption */
|
|
552
856
|
get caption(): string;
|
|
553
|
-
/** Tipo MIME del contenido */
|
|
857
|
+
/** Tipo MIME del contenido / Content MIME type */
|
|
554
858
|
get mime(): string;
|
|
555
|
-
/** Estado del mensaje */
|
|
859
|
+
/** Estado del mensaje / Message status */
|
|
556
860
|
get status(): MESSAGE_STATUS;
|
|
557
|
-
/** true si el mensaje está destacado */
|
|
861
|
+
/** true si el mensaje está destacado / true if starred */
|
|
558
862
|
get starred(): boolean;
|
|
559
|
-
/** true si el mensaje fue reenviado */
|
|
863
|
+
/** true si el mensaje fue reenviado / true if forwarded */
|
|
560
864
|
get forwarded(): boolean;
|
|
561
|
-
/** Timestamp de creación (ms) */
|
|
865
|
+
/** Timestamp de creación (ms) / Creation timestamp (ms) */
|
|
562
866
|
get created_at(): number;
|
|
563
|
-
/** Timestamp de expiración (ms) o null */
|
|
867
|
+
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
564
868
|
get deleted_at(): number | null;
|
|
565
869
|
} | null>;
|
|
566
870
|
/**
|
|
567
871
|
* @description Observa cambios en un mensaje específico.
|
|
568
|
-
*
|
|
569
|
-
* @
|
|
570
|
-
* @param handler Callback con el mensaje actualizado.
|
|
571
|
-
* @returns Función para dejar de observar.
|
|
872
|
+
* Watches changes on a specific message.
|
|
873
|
+
* @returns Función para dejar de observar / Unsubscribe function.
|
|
572
874
|
*/
|
|
573
875
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
notify(cid: string, mid: string): void;
|
|
876
|
+
} & {
|
|
877
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
878
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
879
|
+
_notify: (cid: string, mid: string) => void;
|
|
880
|
+
_build_index: typeof build_message_index;
|
|
580
881
|
};
|
|
882
|
+
export {};
|