@arcaelas/whatsapp 2.0.0 → 2.2.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 +16 -16
- package/build/cjs/Chat.js +6 -4
- package/build/cjs/Chat.js.map +1 -1
- package/build/cjs/Contact.d.ts +303 -9
- package/build/cjs/Contact.js +18 -0
- package/build/cjs/Contact.js.map +1 -1
- package/build/cjs/Message.d.ts +20 -0
- package/build/cjs/Message.js +34 -2
- package/build/cjs/Message.js.map +1 -1
- package/build/cjs/WhatsApp.d.ts +3 -3
- package/build/cjs/WhatsApp.js +19 -9
- package/build/cjs/WhatsApp.js.map +1 -1
- package/build/esm/Chat.d.ts +16 -16
- package/build/esm/Chat.js +6 -4
- package/build/esm/Chat.js.map +1 -1
- package/build/esm/Contact.d.ts +303 -9
- package/build/esm/Contact.js +18 -0
- package/build/esm/Contact.js.map +1 -1
- package/build/esm/Message.d.ts +20 -0
- package/build/esm/Message.js +34 -2
- package/build/esm/Message.js.map +1 -1
- package/build/esm/WhatsApp.d.ts +3 -3
- package/build/esm/WhatsApp.js +19 -9
- package/build/esm/WhatsApp.js.map +1 -1
- package/package.json +1 -1
package/build/cjs/Chat.d.ts
CHANGED
|
@@ -64,13 +64,13 @@ export declare class Chat {
|
|
|
64
64
|
/** Descripción del chat/grupo / Chat/group description */
|
|
65
65
|
get content(): string;
|
|
66
66
|
/** Si está fijado / Whether it's pinned */
|
|
67
|
-
get
|
|
67
|
+
get pinned(): boolean;
|
|
68
68
|
/** Si está archivado / Whether it's archived */
|
|
69
69
|
get archived(): boolean;
|
|
70
|
-
/** Timestamp cuando expira el silencio
|
|
71
|
-
get muted(): number
|
|
70
|
+
/** Timestamp cuando expira el silencio (0 = no silenciado) / Mute end timestamp (0 = not muted) */
|
|
71
|
+
get muted(): number;
|
|
72
72
|
/** Si está leído / Whether it's read */
|
|
73
|
-
get
|
|
73
|
+
get read(): boolean;
|
|
74
74
|
/** Si es solo lectura / Whether it's read-only */
|
|
75
75
|
get readonly(): boolean;
|
|
76
76
|
}
|
|
@@ -137,13 +137,13 @@ export declare function chat(wa: WhatsApp): {
|
|
|
137
137
|
/** Descripción del chat/grupo / Chat/group description */
|
|
138
138
|
get content(): string;
|
|
139
139
|
/** Si está fijado / Whether it's pinned */
|
|
140
|
-
get
|
|
140
|
+
get pinned(): boolean;
|
|
141
141
|
/** Si está archivado / Whether it's archived */
|
|
142
142
|
get archived(): boolean;
|
|
143
|
-
/** Timestamp cuando expira el silencio
|
|
144
|
-
get muted(): number
|
|
143
|
+
/** Timestamp cuando expira el silencio (0 = no silenciado) / Mute end timestamp (0 = not muted) */
|
|
144
|
+
get muted(): number;
|
|
145
145
|
/** Si está leído / Whether it's read */
|
|
146
|
-
get
|
|
146
|
+
get read(): boolean;
|
|
147
147
|
/** Si es solo lectura / Whether it's read-only */
|
|
148
148
|
get readonly(): boolean;
|
|
149
149
|
};
|
|
@@ -208,13 +208,13 @@ export declare function chat(wa: WhatsApp): {
|
|
|
208
208
|
/** Descripción del chat/grupo / Chat/group description */
|
|
209
209
|
get content(): string;
|
|
210
210
|
/** Si está fijado / Whether it's pinned */
|
|
211
|
-
get
|
|
211
|
+
get pinned(): boolean;
|
|
212
212
|
/** Si está archivado / Whether it's archived */
|
|
213
213
|
get archived(): boolean;
|
|
214
|
-
/** Timestamp cuando expira el silencio
|
|
215
|
-
get muted(): number
|
|
214
|
+
/** Timestamp cuando expira el silencio (0 = no silenciado) / Mute end timestamp (0 = not muted) */
|
|
215
|
+
get muted(): number;
|
|
216
216
|
/** Si está leído / Whether it's read */
|
|
217
|
-
get
|
|
217
|
+
get read(): boolean;
|
|
218
218
|
/** Si es solo lectura / Whether it's read-only */
|
|
219
219
|
get readonly(): boolean;
|
|
220
220
|
} | null>;
|
|
@@ -279,13 +279,13 @@ export declare function chat(wa: WhatsApp): {
|
|
|
279
279
|
/** Descripción del chat/grupo / Chat/group description */
|
|
280
280
|
get content(): string;
|
|
281
281
|
/** Si está fijado / Whether it's pinned */
|
|
282
|
-
get
|
|
282
|
+
get pinned(): boolean;
|
|
283
283
|
/** Si está archivado / Whether it's archived */
|
|
284
284
|
get archived(): boolean;
|
|
285
|
-
/** Timestamp cuando expira el silencio
|
|
286
|
-
get muted(): number
|
|
285
|
+
/** Timestamp cuando expira el silencio (0 = no silenciado) / Mute end timestamp (0 = not muted) */
|
|
286
|
+
get muted(): number;
|
|
287
287
|
/** Si está leído / Whether it's read */
|
|
288
|
-
get
|
|
288
|
+
get read(): boolean;
|
|
289
289
|
/** Si es solo lectura / Whether it's read-only */
|
|
290
290
|
get readonly(): boolean;
|
|
291
291
|
}[]>;
|
package/build/cjs/Chat.js
CHANGED
|
@@ -25,13 +25,13 @@ class Chat {
|
|
|
25
25
|
/** Descripción del chat/grupo / Chat/group description */
|
|
26
26
|
get content() { return this.raw.description ?? ''; }
|
|
27
27
|
/** Si está fijado / Whether it's pinned */
|
|
28
|
-
get
|
|
28
|
+
get pinned() { return this.raw.pinned !== null && this.raw.pinned !== undefined; }
|
|
29
29
|
/** Si está archivado / Whether it's archived */
|
|
30
30
|
get archived() { return this.raw.archived ?? false; }
|
|
31
|
-
/** Timestamp cuando expira el silencio
|
|
32
|
-
get muted() { return this.raw.muteEndTime ??
|
|
31
|
+
/** Timestamp cuando expira el silencio (0 = no silenciado) / Mute end timestamp (0 = not muted) */
|
|
32
|
+
get muted() { return this.raw.muteEndTime ?? 0; }
|
|
33
33
|
/** Si está leído / Whether it's read */
|
|
34
|
-
get
|
|
34
|
+
get read() { return (this.raw.unreadCount === 0 || this.raw.unreadCount === null) && !this.raw.markedAsUnread; }
|
|
35
35
|
/** Si es solo lectura / Whether it's read-only */
|
|
36
36
|
get readonly() { return this.raw.readOnly ?? false; }
|
|
37
37
|
}
|
|
@@ -81,6 +81,8 @@ function chat(wa) {
|
|
|
81
81
|
static async list(offset = 0, limit = 50) {
|
|
82
82
|
const chats = [];
|
|
83
83
|
for (const key of await wa.engine.list('chat/', offset, limit)) {
|
|
84
|
+
if (!key.endsWith('/index'))
|
|
85
|
+
continue;
|
|
84
86
|
const stored = await wa.engine.get(key);
|
|
85
87
|
if (stored)
|
|
86
88
|
chats.push(new _Chat(JSON.parse(stored, baileys_1.BufferJSON.reviver)));
|
package/build/cjs/Chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/Chat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoFH,
|
|
1
|
+
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/Chat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoFH,oBAoOC;AAtTD,qCAAqC;AAiDrC;;;;GAIG;AACH,MAAa,IAAI;IACb,YAAqB,GAAa;QAAb,QAAG,GAAH,GAAG,CAAU;IAAI,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,EAAE,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,+BAA+B;IAC/B,IAAI,IAAI,KAA0B,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/F,kCAAkC;IAClC,IAAI,IAAI,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,0DAA0D;IAC1D,IAAI,OAAO,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC;IAC5D,2CAA2C;IAC3C,IAAI,MAAM,KAAc,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,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EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;oBACzB,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,oBAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACvF,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;gBACtC,CAAC;YACL,CAAC;YACD,OAAO,OAAO,CAAC;QACnB,CAAC;QAED;;;WAGG;QACH,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC;QAED;;;WAGG;QACH,KAAK,CAAC,OAAO;YACT,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;gBAAE,OAAO,IAAI,CAAC;YACvC,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;KACJ,CAAC;IAEF,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/build/cjs/Contact.d.ts
CHANGED
|
@@ -286,6 +286,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
286
286
|
get created_at(): number;
|
|
287
287
|
get deleted_at(): number | null;
|
|
288
288
|
} | null>;
|
|
289
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
290
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
291
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
292
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
289
293
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
290
294
|
} & {
|
|
291
295
|
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
@@ -299,10 +303,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
299
303
|
get type(): "contact" | "group";
|
|
300
304
|
get name(): string;
|
|
301
305
|
get content(): string;
|
|
302
|
-
get
|
|
306
|
+
get pinned(): boolean;
|
|
303
307
|
get archived(): boolean;
|
|
304
|
-
get muted(): number
|
|
305
|
-
get
|
|
308
|
+
get muted(): number;
|
|
309
|
+
get read(): boolean;
|
|
306
310
|
get readonly(): boolean;
|
|
307
311
|
} | null>;
|
|
308
312
|
readonly raw: IContactRaw;
|
|
@@ -560,6 +564,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
560
564
|
get created_at(): number;
|
|
561
565
|
get deleted_at(): number | null;
|
|
562
566
|
} | null>;
|
|
567
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
568
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
569
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
570
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
563
571
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
564
572
|
} & {
|
|
565
573
|
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
@@ -573,10 +581,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
573
581
|
get type(): "contact" | "group";
|
|
574
582
|
get name(): string;
|
|
575
583
|
get content(): string;
|
|
576
|
-
get
|
|
584
|
+
get pinned(): boolean;
|
|
577
585
|
get archived(): boolean;
|
|
578
|
-
get muted(): number
|
|
579
|
-
get
|
|
586
|
+
get muted(): number;
|
|
587
|
+
get read(): boolean;
|
|
580
588
|
get readonly(): boolean;
|
|
581
589
|
} | null>;
|
|
582
590
|
readonly raw: IContactRaw;
|
|
@@ -835,6 +843,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
835
843
|
get created_at(): number;
|
|
836
844
|
get deleted_at(): number | null;
|
|
837
845
|
} | null>;
|
|
846
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
847
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
848
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
849
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
838
850
|
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
839
851
|
} & {
|
|
840
852
|
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
@@ -848,10 +860,10 @@ export declare function contact(wa: WhatsApp): {
|
|
|
848
860
|
get type(): "contact" | "group";
|
|
849
861
|
get name(): string;
|
|
850
862
|
get content(): string;
|
|
851
|
-
get
|
|
863
|
+
get pinned(): boolean;
|
|
852
864
|
get archived(): boolean;
|
|
853
|
-
get muted(): number
|
|
854
|
-
get
|
|
865
|
+
get muted(): number;
|
|
866
|
+
get read(): boolean;
|
|
855
867
|
get readonly(): boolean;
|
|
856
868
|
} | null>;
|
|
857
869
|
readonly raw: IContactRaw;
|
|
@@ -866,4 +878,286 @@ export declare function contact(wa: WhatsApp): {
|
|
|
866
878
|
/** Bio del contacto / Contact bio */
|
|
867
879
|
get content(): string;
|
|
868
880
|
}[]>;
|
|
881
|
+
/**
|
|
882
|
+
* @description Cambia el nombre de un contacto por su ID.
|
|
883
|
+
* Renames a contact by its ID.
|
|
884
|
+
*/
|
|
885
|
+
rename(uid: string, name: string): Promise<boolean>;
|
|
886
|
+
/**
|
|
887
|
+
* @description Actualiza los datos de un contacto desde WhatsApp por su ID.
|
|
888
|
+
* Refreshes a contact's data from WhatsApp by its ID.
|
|
889
|
+
*/
|
|
890
|
+
refresh(uid: string): Promise<{
|
|
891
|
+
/**
|
|
892
|
+
* @description Cambia el nombre del contacto.
|
|
893
|
+
* Renames the contact.
|
|
894
|
+
* @param name Nuevo nombre.
|
|
895
|
+
*/
|
|
896
|
+
rename(name: string): Promise<boolean>;
|
|
897
|
+
/**
|
|
898
|
+
* @description Actualiza los datos del perfil desde WhatsApp.
|
|
899
|
+
* Refreshes profile data from WhatsApp.
|
|
900
|
+
*/
|
|
901
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
902
|
+
/**
|
|
903
|
+
* @description Obtiene o crea el chat con este contacto.
|
|
904
|
+
* Gets or creates the chat with this contact.
|
|
905
|
+
*/
|
|
906
|
+
chat(): Promise<{
|
|
907
|
+
refresh(): Promise</*elided*/ any | null>;
|
|
908
|
+
remove(): Promise<boolean>;
|
|
909
|
+
pin(value: boolean): Promise<boolean>;
|
|
910
|
+
archive(value: boolean): Promise<boolean>;
|
|
911
|
+
mute(duration: number | null): Promise<boolean>;
|
|
912
|
+
seen(): Promise<boolean>;
|
|
913
|
+
members(offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
914
|
+
messages(offset?: number, limit?: number): Promise<InstanceType<{
|
|
915
|
+
new (data: import("./Message").IMessage): {
|
|
916
|
+
edit(text: string): Promise<boolean>;
|
|
917
|
+
remove(): Promise<boolean>;
|
|
918
|
+
forward(to_cid: string): Promise<boolean>;
|
|
919
|
+
react(emoji: string): Promise<boolean>;
|
|
920
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
921
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
922
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
923
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
924
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
925
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
926
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
927
|
+
content(): Promise<Buffer>;
|
|
928
|
+
readonly index: import("./Message").IMessageIndex;
|
|
929
|
+
readonly raw: import("baileys").WAMessage;
|
|
930
|
+
get id(): string;
|
|
931
|
+
get cid(): string;
|
|
932
|
+
get mid(): string | null;
|
|
933
|
+
get me(): boolean;
|
|
934
|
+
get author(): string;
|
|
935
|
+
get edited(): boolean;
|
|
936
|
+
get type(): import("./Message").MessageType;
|
|
937
|
+
get caption(): string;
|
|
938
|
+
get mime(): string;
|
|
939
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
940
|
+
get starred(): boolean;
|
|
941
|
+
get forwarded(): boolean;
|
|
942
|
+
get created_at(): number;
|
|
943
|
+
get deleted_at(): number | null;
|
|
944
|
+
};
|
|
945
|
+
get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
|
|
946
|
+
list(cid: string, offset?: number, limit?: number): Promise<InstanceType</*elided*/ any>[]>;
|
|
947
|
+
count(cid: string): Promise<number>;
|
|
948
|
+
text(cid: string, text: string, mid?: string): Promise<{
|
|
949
|
+
edit(text: string): Promise<boolean>;
|
|
950
|
+
remove(): Promise<boolean>;
|
|
951
|
+
forward(to_cid: string): Promise<boolean>;
|
|
952
|
+
react(emoji: string): Promise<boolean>;
|
|
953
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
954
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
955
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
956
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
957
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
958
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
959
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
960
|
+
content(): Promise<Buffer>;
|
|
961
|
+
readonly index: import("./Message").IMessageIndex;
|
|
962
|
+
readonly raw: import("baileys").WAMessage;
|
|
963
|
+
get id(): string;
|
|
964
|
+
get cid(): string;
|
|
965
|
+
get mid(): string | null;
|
|
966
|
+
get me(): boolean;
|
|
967
|
+
get author(): string;
|
|
968
|
+
get edited(): boolean;
|
|
969
|
+
get type(): import("./Message").MessageType;
|
|
970
|
+
get caption(): string;
|
|
971
|
+
get mime(): string;
|
|
972
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
973
|
+
get starred(): boolean;
|
|
974
|
+
get forwarded(): boolean;
|
|
975
|
+
get created_at(): number;
|
|
976
|
+
get deleted_at(): number | null;
|
|
977
|
+
} | null>;
|
|
978
|
+
image(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
979
|
+
edit(text: string): Promise<boolean>;
|
|
980
|
+
remove(): Promise<boolean>;
|
|
981
|
+
forward(to_cid: string): Promise<boolean>;
|
|
982
|
+
react(emoji: string): Promise<boolean>;
|
|
983
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
984
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
985
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
986
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
987
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
988
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
989
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
990
|
+
content(): Promise<Buffer>;
|
|
991
|
+
readonly index: import("./Message").IMessageIndex;
|
|
992
|
+
readonly raw: import("baileys").WAMessage;
|
|
993
|
+
get id(): string;
|
|
994
|
+
get cid(): string;
|
|
995
|
+
get mid(): string | null;
|
|
996
|
+
get me(): boolean;
|
|
997
|
+
get author(): string;
|
|
998
|
+
get edited(): boolean;
|
|
999
|
+
get type(): import("./Message").MessageType;
|
|
1000
|
+
get caption(): string;
|
|
1001
|
+
get mime(): string;
|
|
1002
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
1003
|
+
get starred(): boolean;
|
|
1004
|
+
get forwarded(): boolean;
|
|
1005
|
+
get created_at(): number;
|
|
1006
|
+
get deleted_at(): number | null;
|
|
1007
|
+
} | null>;
|
|
1008
|
+
video(cid: string, buffer: Buffer, caption?: string, mid?: string): Promise<{
|
|
1009
|
+
edit(text: string): Promise<boolean>;
|
|
1010
|
+
remove(): Promise<boolean>;
|
|
1011
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1012
|
+
react(emoji: string): Promise<boolean>;
|
|
1013
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1014
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1015
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1016
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1017
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1018
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
1019
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
1020
|
+
content(): Promise<Buffer>;
|
|
1021
|
+
readonly index: import("./Message").IMessageIndex;
|
|
1022
|
+
readonly raw: import("baileys").WAMessage;
|
|
1023
|
+
get id(): string;
|
|
1024
|
+
get cid(): string;
|
|
1025
|
+
get mid(): string | null;
|
|
1026
|
+
get me(): boolean;
|
|
1027
|
+
get author(): string;
|
|
1028
|
+
get edited(): boolean;
|
|
1029
|
+
get type(): import("./Message").MessageType;
|
|
1030
|
+
get caption(): string;
|
|
1031
|
+
get mime(): string;
|
|
1032
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
1033
|
+
get starred(): boolean;
|
|
1034
|
+
get forwarded(): boolean;
|
|
1035
|
+
get created_at(): number;
|
|
1036
|
+
get deleted_at(): number | null;
|
|
1037
|
+
} | null>;
|
|
1038
|
+
audio(cid: string, buffer: Buffer, ptt?: boolean, mid?: string): Promise<{
|
|
1039
|
+
edit(text: string): Promise<boolean>;
|
|
1040
|
+
remove(): Promise<boolean>;
|
|
1041
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1042
|
+
react(emoji: string): Promise<boolean>;
|
|
1043
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1044
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1045
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1046
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1047
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1048
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
1049
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
1050
|
+
content(): Promise<Buffer>;
|
|
1051
|
+
readonly index: import("./Message").IMessageIndex;
|
|
1052
|
+
readonly raw: import("baileys").WAMessage;
|
|
1053
|
+
get id(): string;
|
|
1054
|
+
get cid(): string;
|
|
1055
|
+
get mid(): string | null;
|
|
1056
|
+
get me(): boolean;
|
|
1057
|
+
get author(): string;
|
|
1058
|
+
get edited(): boolean;
|
|
1059
|
+
get type(): import("./Message").MessageType;
|
|
1060
|
+
get caption(): string;
|
|
1061
|
+
get mime(): string;
|
|
1062
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
1063
|
+
get starred(): boolean;
|
|
1064
|
+
get forwarded(): boolean;
|
|
1065
|
+
get created_at(): number;
|
|
1066
|
+
get deleted_at(): number | null;
|
|
1067
|
+
} | null>;
|
|
1068
|
+
location(cid: string, opts: import("./Message").LocationOptions, mid?: string): Promise<{
|
|
1069
|
+
edit(text: string): Promise<boolean>;
|
|
1070
|
+
remove(): Promise<boolean>;
|
|
1071
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1072
|
+
react(emoji: string): Promise<boolean>;
|
|
1073
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1074
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1075
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1076
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1077
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1078
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
1079
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
1080
|
+
content(): Promise<Buffer>;
|
|
1081
|
+
readonly index: import("./Message").IMessageIndex;
|
|
1082
|
+
readonly raw: import("baileys").WAMessage;
|
|
1083
|
+
get id(): string;
|
|
1084
|
+
get cid(): string;
|
|
1085
|
+
get mid(): string | null;
|
|
1086
|
+
get me(): boolean;
|
|
1087
|
+
get author(): string;
|
|
1088
|
+
get edited(): boolean;
|
|
1089
|
+
get type(): import("./Message").MessageType;
|
|
1090
|
+
get caption(): string;
|
|
1091
|
+
get mime(): string;
|
|
1092
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
1093
|
+
get starred(): boolean;
|
|
1094
|
+
get forwarded(): boolean;
|
|
1095
|
+
get created_at(): number;
|
|
1096
|
+
get deleted_at(): number | null;
|
|
1097
|
+
} | null>;
|
|
1098
|
+
poll(cid: string, opts: import("./Message").PollOptions, mid?: string): Promise<{
|
|
1099
|
+
edit(text: string): Promise<boolean>;
|
|
1100
|
+
remove(): Promise<boolean>;
|
|
1101
|
+
forward(to_cid: string): Promise<boolean>;
|
|
1102
|
+
react(emoji: string): Promise<boolean>;
|
|
1103
|
+
text(content: string): Promise</*elided*/ any | null>;
|
|
1104
|
+
image(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1105
|
+
video(buffer: Buffer, caption?: string): Promise</*elided*/ any | null>;
|
|
1106
|
+
audio(buffer: Buffer, ptt?: boolean): Promise</*elided*/ any | null>;
|
|
1107
|
+
location(opts: import("./Message").LocationOptions): Promise</*elided*/ any | null>;
|
|
1108
|
+
poll(opts: import("./Message").PollOptions): Promise</*elided*/ any | null>;
|
|
1109
|
+
stream(): Promise<import("node:stream").Readable>;
|
|
1110
|
+
content(): Promise<Buffer>;
|
|
1111
|
+
readonly index: import("./Message").IMessageIndex;
|
|
1112
|
+
readonly raw: import("baileys").WAMessage;
|
|
1113
|
+
get id(): string;
|
|
1114
|
+
get cid(): string;
|
|
1115
|
+
get mid(): string | null;
|
|
1116
|
+
get me(): boolean;
|
|
1117
|
+
get author(): string;
|
|
1118
|
+
get edited(): boolean;
|
|
1119
|
+
get type(): import("./Message").MessageType;
|
|
1120
|
+
get caption(): string;
|
|
1121
|
+
get mime(): string;
|
|
1122
|
+
get status(): import("./Message").MESSAGE_STATUS;
|
|
1123
|
+
get starred(): boolean;
|
|
1124
|
+
get forwarded(): boolean;
|
|
1125
|
+
get created_at(): number;
|
|
1126
|
+
get deleted_at(): number | null;
|
|
1127
|
+
} | null>;
|
|
1128
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
1129
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
1130
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
1131
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
1132
|
+
watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
|
|
1133
|
+
} & {
|
|
1134
|
+
_add_to_index: (cid: string, mid: string, timestamp: number) => Promise<void>;
|
|
1135
|
+
_remove_from_index: (cid: string, mid: string) => Promise<void>;
|
|
1136
|
+
_notify: (cid: string, mid: string) => void;
|
|
1137
|
+
_build_index: (raw: import("baileys").WAMessage, edited?: boolean) => import("./Message").IMessageIndex;
|
|
1138
|
+
}>[]>;
|
|
1139
|
+
contact(): Promise<InstanceType</*elided*/ any> | null>;
|
|
1140
|
+
readonly raw: import("./Chat").IChatRaw;
|
|
1141
|
+
get id(): string;
|
|
1142
|
+
get type(): "contact" | "group";
|
|
1143
|
+
get name(): string;
|
|
1144
|
+
get content(): string;
|
|
1145
|
+
get pinned(): boolean;
|
|
1146
|
+
get archived(): boolean;
|
|
1147
|
+
get muted(): number;
|
|
1148
|
+
get read(): boolean;
|
|
1149
|
+
get readonly(): boolean;
|
|
1150
|
+
} | null>;
|
|
1151
|
+
readonly raw: IContactRaw;
|
|
1152
|
+
/** JID único del contacto / Unique contact JID */
|
|
1153
|
+
get id(): string;
|
|
1154
|
+
/** Nombre del contacto / Contact name */
|
|
1155
|
+
get name(): string;
|
|
1156
|
+
/** URL de la foto de perfil o null / Profile picture URL or null */
|
|
1157
|
+
get photo(): string | null;
|
|
1158
|
+
/** Número de teléfono sin formato / Phone number without format */
|
|
1159
|
+
get phone(): string;
|
|
1160
|
+
/** Bio del contacto / Contact bio */
|
|
1161
|
+
get content(): string;
|
|
1162
|
+
} | null>;
|
|
869
1163
|
};
|
package/build/cjs/Contact.js
CHANGED
|
@@ -92,12 +92,30 @@ function contact(wa) {
|
|
|
92
92
|
static async list(offset = 0, limit = 50) {
|
|
93
93
|
const contacts = [];
|
|
94
94
|
for (const key of await wa.engine.list('contact/', offset, limit)) {
|
|
95
|
+
if (!key.endsWith('/index'))
|
|
96
|
+
continue;
|
|
95
97
|
const stored = await wa.engine.get(key);
|
|
96
98
|
if (stored)
|
|
97
99
|
contacts.push(new _Contact(JSON.parse(stored, baileys_1.BufferJSON.reviver)));
|
|
98
100
|
}
|
|
99
101
|
return contacts;
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* @description Cambia el nombre de un contacto por su ID.
|
|
105
|
+
* Renames a contact by its ID.
|
|
106
|
+
*/
|
|
107
|
+
static async rename(uid, name) {
|
|
108
|
+
const contact = await _Contact.get(uid);
|
|
109
|
+
return contact ? contact.rename(name) : false;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @description Actualiza los datos de un contacto desde WhatsApp por su ID.
|
|
113
|
+
* Refreshes a contact's data from WhatsApp by its ID.
|
|
114
|
+
*/
|
|
115
|
+
static async refresh(uid) {
|
|
116
|
+
const contact = await _Contact.get(uid);
|
|
117
|
+
return contact ? contact.refresh() : null;
|
|
118
|
+
}
|
|
101
119
|
/**
|
|
102
120
|
* @description Cambia el nombre del contacto.
|
|
103
121
|
* Renames the contact.
|
package/build/cjs/Contact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contact.js","sourceRoot":"","sources":["../../src/Contact.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH,
|
|
1
|
+
{"version":3,"file":"Contact.js","sourceRoot":"","sources":["../../src/Contact.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH,0BAyGC;AA1KD,qCAAwD;AAwBxD;;;GAGG;AACH,SAAS,aAAa,CAAC,GAAgB;IACnC,OAAO;QACH,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI;QACpB,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI;QACtB,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,IAAI;QAC1B,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI;QACtC,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,IAAI;QAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,IAAI;KAC7B,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAa,OAAO;IAChB,YAAqB,GAAgB;QAAhB,QAAG,GAAH,GAAG,CAAa;IAAI,CAAC;IAE1C,kDAAkD;IAClD,IAAI,EAAE,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,yCAAyC;IACzC,IAAI,IAAI,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,oEAAoE;IACpE,IAAI,KAAK,KAAoB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC;IAC9D,mEAAmE;IACnE,IAAI,KAAK,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KA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CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;YACpF,CAAC;YAAC,MAAM,CAAC,CAAC,mCAAmC,CAAC,CAAC;YAC/C,IAAI,CAAC;gBACD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,CAAC,CAAiD,CAAC;gBAChF,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,WAAW,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;YAC1D,CAAC;YAAC,MAAM,CAAC,CAAC,2BAA2B,CAAC,CAAC;YACvC,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC/F,OAAO,IAAI,CAAC;QAChB,CAAC;QAED;;;WAGG;QACH,KAAK,CAAC,IAAI;YACN,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/build/cjs/Message.d.ts
CHANGED
|
@@ -867,6 +867,26 @@ export declare function message(wa: WhatsApp): {
|
|
|
867
867
|
/** Timestamp de expiración (ms) o null / Expiration timestamp (ms) or null */
|
|
868
868
|
get deleted_at(): number | null;
|
|
869
869
|
} | null>;
|
|
870
|
+
/**
|
|
871
|
+
* @description Edita un mensaje por CID y MID.
|
|
872
|
+
* Edits a message by CID and MID.
|
|
873
|
+
*/
|
|
874
|
+
edit(cid: string, mid: string, text: string): Promise<boolean>;
|
|
875
|
+
/**
|
|
876
|
+
* @description Elimina un mensaje por CID y MID.
|
|
877
|
+
* Deletes a message by CID and MID.
|
|
878
|
+
*/
|
|
879
|
+
remove(cid: string, mid: string): Promise<boolean>;
|
|
880
|
+
/**
|
|
881
|
+
* @description Reacciona a un mensaje por CID y MID.
|
|
882
|
+
* Reacts to a message by CID and MID.
|
|
883
|
+
*/
|
|
884
|
+
react(cid: string, mid: string, emoji: string): Promise<boolean>;
|
|
885
|
+
/**
|
|
886
|
+
* @description Reenvía un mensaje por CID y MID a otro chat.
|
|
887
|
+
* Forwards a message by CID and MID to another chat.
|
|
888
|
+
*/
|
|
889
|
+
forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
|
|
870
890
|
/**
|
|
871
891
|
* @description Observa cambios en un mensaje específico.
|
|
872
892
|
* Watches changes on a specific message.
|
package/build/cjs/Message.js
CHANGED
|
@@ -67,11 +67,11 @@ function build_message_index(raw, edited = false) {
|
|
|
67
67
|
caption = msg_content.caption ?? msg_content.text ?? msg_content.name ?? '';
|
|
68
68
|
return {
|
|
69
69
|
id: key.id ?? '',
|
|
70
|
-
cid: key.remoteJid
|
|
70
|
+
cid: key.remoteJidAlt || key.remoteJid || '',
|
|
71
71
|
mid: context_info?.stanzaId ?? null,
|
|
72
72
|
me: key.fromMe ?? false,
|
|
73
73
|
type: msg_type,
|
|
74
|
-
author: key.participant
|
|
74
|
+
author: key.participant || key.remoteJid || '',
|
|
75
75
|
status: raw.status ?? MESSAGE_STATUS.PENDING,
|
|
76
76
|
starred: raw.starred ?? false,
|
|
77
77
|
forwarded: context_info?.isForwarded ?? false,
|
|
@@ -288,6 +288,38 @@ function message(wa) {
|
|
|
288
288
|
static async poll(cid, opts, mid) {
|
|
289
289
|
return _send(cid, { poll: { name: opts.content, values: opts.options.map((o) => o.content), selectableCount: 1 } }, undefined, mid);
|
|
290
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* @description Edita un mensaje por CID y MID.
|
|
293
|
+
* Edits a message by CID and MID.
|
|
294
|
+
*/
|
|
295
|
+
static async edit(cid, mid, text) {
|
|
296
|
+
const msg = await _Message.get(cid, mid);
|
|
297
|
+
return msg ? msg.edit(text) : false;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* @description Elimina un mensaje por CID y MID.
|
|
301
|
+
* Deletes a message by CID and MID.
|
|
302
|
+
*/
|
|
303
|
+
static async remove(cid, mid) {
|
|
304
|
+
const msg = await _Message.get(cid, mid);
|
|
305
|
+
return msg ? msg.remove() : false;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* @description Reacciona a un mensaje por CID y MID.
|
|
309
|
+
* Reacts to a message by CID and MID.
|
|
310
|
+
*/
|
|
311
|
+
static async react(cid, mid, emoji) {
|
|
312
|
+
const msg = await _Message.get(cid, mid);
|
|
313
|
+
return msg ? msg.react(emoji) : false;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* @description Reenvía un mensaje por CID y MID a otro chat.
|
|
317
|
+
* Forwards a message by CID and MID to another chat.
|
|
318
|
+
*/
|
|
319
|
+
static async forward(cid, mid, to_cid) {
|
|
320
|
+
const msg = await _Message.get(cid, mid);
|
|
321
|
+
return msg ? msg.forward(to_cid) : false;
|
|
322
|
+
}
|
|
291
323
|
/**
|
|
292
324
|
* @description Observa cambios en un mensaje específico.
|
|
293
325
|
* Watches changes on a specific message.
|