zaileys 0.28.6-dev → 0.28.7-dev
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/dist/index.d.mts +152 -24
- package/dist/index.d.ts +152 -24
- package/dist/index.js +42 -42
- package/dist/index.mjs +42 -42
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as baileys from '@whiskeysockets/baileys';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
+
import NodeCache from 'node-cache';
|
|
4
|
+
import BLog from 'beautify-console-log';
|
|
3
5
|
|
|
4
6
|
declare class Actions extends EventEmitter {
|
|
5
7
|
private client;
|
|
@@ -21,7 +23,51 @@ declare class Actions extends EventEmitter {
|
|
|
21
23
|
groupsUpdate(updates: baileys.BaileysEventMap['groups.update']): void;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Decode a JID
|
|
28
|
+
* @param jid The JID to decode
|
|
29
|
+
* @returns The decoded JID
|
|
30
|
+
*/
|
|
31
|
+
declare const decodeJid: (jid: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Serialize a message
|
|
34
|
+
* @param client The Baileys client
|
|
35
|
+
* @param msg The message to serialize
|
|
36
|
+
* @returns The serialized message
|
|
37
|
+
*/
|
|
38
|
+
declare function Serialize(client: ReturnType<typeof baileys.default>, config: Client, msg: any): SerializedMessage | undefined;
|
|
39
|
+
interface SerializedMessage {
|
|
40
|
+
roomId: string;
|
|
41
|
+
roomType: RoomType;
|
|
42
|
+
senderId: string;
|
|
43
|
+
senderName: string;
|
|
44
|
+
isMe: boolean;
|
|
45
|
+
isBot: boolean;
|
|
46
|
+
isMedia: boolean;
|
|
47
|
+
isEphemeral: boolean;
|
|
48
|
+
isAuthor: boolean;
|
|
49
|
+
msgType: string;
|
|
50
|
+
msgBody: string;
|
|
51
|
+
msgMentions: string[];
|
|
52
|
+
msgExpiration: number;
|
|
53
|
+
msgTimestamp: number;
|
|
54
|
+
msgMedia?: {
|
|
55
|
+
url: string;
|
|
56
|
+
mimetype: string;
|
|
57
|
+
size: number;
|
|
58
|
+
height: number;
|
|
59
|
+
width: number;
|
|
60
|
+
isAnimated: boolean;
|
|
61
|
+
isAvatar: boolean;
|
|
62
|
+
isAiSticker: boolean;
|
|
63
|
+
isLottie: boolean;
|
|
64
|
+
};
|
|
65
|
+
msgQuoted?: SerializedMessage;
|
|
66
|
+
payload(): baileys.WAProto.IWebMessageInfo;
|
|
67
|
+
key(): baileys.WAProto.IMessageKey;
|
|
68
|
+
}
|
|
69
|
+
type RoomType = 'group' | 'private' | 'channel';
|
|
70
|
+
|
|
25
71
|
interface ClientProps {
|
|
26
72
|
phoneNumber: number;
|
|
27
73
|
method: 'pairing' | 'qr';
|
|
@@ -31,12 +77,14 @@ interface ClientProps {
|
|
|
31
77
|
authors?: number[];
|
|
32
78
|
ignoreMe?: boolean;
|
|
33
79
|
}
|
|
34
|
-
declare class Client
|
|
80
|
+
declare class Client {
|
|
35
81
|
private client;
|
|
36
|
-
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private
|
|
82
|
+
private listeners;
|
|
83
|
+
private pino;
|
|
84
|
+
private authPath;
|
|
85
|
+
private credsPath;
|
|
86
|
+
private storePath;
|
|
87
|
+
private logger;
|
|
40
88
|
readonly phoneNumber: number;
|
|
41
89
|
readonly method: 'pairing' | 'qr';
|
|
42
90
|
readonly showLogs: boolean;
|
|
@@ -44,24 +92,104 @@ declare class Client extends EventEmitter {
|
|
|
44
92
|
readonly autoRead: boolean;
|
|
45
93
|
readonly authors: number[];
|
|
46
94
|
readonly ignoreMe: boolean;
|
|
47
|
-
private isRunning;
|
|
48
95
|
constructor(props: ClientProps);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
private
|
|
96
|
+
initialize(): Promise<void>;
|
|
97
|
+
private pairingCode;
|
|
98
|
+
private handler;
|
|
99
|
+
private emit;
|
|
100
|
+
on(event: string, callback: (data: SerializedMessage) => void): void;
|
|
101
|
+
parseMentions(text: any): any;
|
|
102
|
+
send(data: SerializedMessage, text: any): Promise<SerializedMessage | undefined>;
|
|
103
|
+
reply(data: any, text: any): Promise<SerializedMessage | undefined>;
|
|
104
|
+
edit(data: any, target: any, text: any): Promise<SerializedMessage | undefined>;
|
|
105
|
+
reaction(data: any, emoji: any): Promise<SerializedMessage | undefined>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class Logger {
|
|
109
|
+
private bannerLogo;
|
|
110
|
+
private copyright;
|
|
111
|
+
private spinner;
|
|
112
|
+
constructor();
|
|
113
|
+
banner(): void;
|
|
114
|
+
msgLogs(data: SerializedMessage): void;
|
|
115
|
+
runSpinner(text: string): void;
|
|
116
|
+
editSpinner(text: string): void;
|
|
117
|
+
stopSpinner(status: ("succeed" | "fail" | "warn" | "info") | undefined, text: string): void;
|
|
65
118
|
}
|
|
66
119
|
|
|
67
|
-
|
|
120
|
+
declare const bLog: BLog;
|
|
121
|
+
declare const cLog: {
|
|
122
|
+
(...data: any[]): void;
|
|
123
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
124
|
+
};
|
|
125
|
+
declare const cache: NodeCache;
|
|
126
|
+
declare const logBlock: (status?: "succeed" | "fail" | "warn" | "info") => any;
|
|
127
|
+
declare const sleep: (ms: number) => Promise<unknown>;
|
|
128
|
+
|
|
129
|
+
declare const MESSAGE_TYPE: {
|
|
130
|
+
readonly text: "text";
|
|
131
|
+
readonly conversation: "text";
|
|
132
|
+
readonly imageMessage: "image";
|
|
133
|
+
readonly contactMessage: "contact";
|
|
134
|
+
readonly locationMessage: "location";
|
|
135
|
+
readonly extendedTextMessage: "text";
|
|
136
|
+
readonly documentMessage: "document";
|
|
137
|
+
readonly audioMessage: "audio";
|
|
138
|
+
readonly videoMessage: "video";
|
|
139
|
+
readonly protocolMessage: "protocol";
|
|
140
|
+
readonly contactsArrayMessage: "contactsArray";
|
|
141
|
+
readonly highlyStructuredMessage: "highlyStructured";
|
|
142
|
+
readonly sendPaymentMessage: "sendPayment";
|
|
143
|
+
readonly liveLocationMessage: "liveLocation";
|
|
144
|
+
readonly requestPaymentMessage: "requestPayment";
|
|
145
|
+
readonly declinePaymentRequestMessage: "declinePaymentRequest";
|
|
146
|
+
readonly cancelPaymentRequestMessage: "cancelPaymentRequest";
|
|
147
|
+
readonly templateMessage: "template";
|
|
148
|
+
readonly stickerMessage: "sticker";
|
|
149
|
+
readonly groupInviteMessage: "groupInvite";
|
|
150
|
+
readonly templateButtonReplyMessage: "templateButtonReply";
|
|
151
|
+
readonly productMessage: "product";
|
|
152
|
+
readonly deviceSentMessage: "deviceSent";
|
|
153
|
+
readonly listMessage: "list";
|
|
154
|
+
readonly viewOnceMessage: "viewOnce";
|
|
155
|
+
readonly orderMessage: "order";
|
|
156
|
+
readonly listResponseMessage: "listResponse";
|
|
157
|
+
readonly ephemeralMessage: "ephemeral";
|
|
158
|
+
readonly invoiceMessage: "invoice";
|
|
159
|
+
readonly buttonsMessage: "buttons";
|
|
160
|
+
readonly buttonsResponseMessage: "buttonsResponse";
|
|
161
|
+
readonly paymentInviteMessage: "paymentInvite";
|
|
162
|
+
readonly interactiveMessage: "interactive";
|
|
163
|
+
readonly reactionMessage: "reaction";
|
|
164
|
+
readonly stickerSyncRmrMessage: "sticker";
|
|
165
|
+
readonly interactiveResponseMessage: "interactiveResponse";
|
|
166
|
+
readonly pollCreationMessage: "pollCreation";
|
|
167
|
+
readonly pollUpdateMessage: "pollUpdate";
|
|
168
|
+
readonly keepInChatMessage: "keepInChat";
|
|
169
|
+
readonly documentWithCaptionMessage: "document";
|
|
170
|
+
readonly requestPhoneNumberMessage: "requestPhoneNumber";
|
|
171
|
+
readonly viewOnceMessageV2: "viewOnce";
|
|
172
|
+
readonly encReactionMessage: "reaction";
|
|
173
|
+
readonly editedMessage: "text";
|
|
174
|
+
readonly viewOnceMessageV2Extension: "viewOnce";
|
|
175
|
+
readonly pollCreationMessageV2: "pollCreation";
|
|
176
|
+
readonly scheduledCallCreationMessage: "scheduledCallCreation";
|
|
177
|
+
readonly groupMentionedMessage: "groupMentioned";
|
|
178
|
+
readonly pinInChatMessage: "pinInChat";
|
|
179
|
+
readonly pollCreationMessageV3: "pollCreation";
|
|
180
|
+
readonly scheduledCallEditMessage: "scheduledCallEdit";
|
|
181
|
+
readonly ptvMessage: "ptv";
|
|
182
|
+
readonly botInvokeMessage: "botInvoke";
|
|
183
|
+
readonly callLogMesssage: "callLog";
|
|
184
|
+
readonly encCommentMessage: "encComment";
|
|
185
|
+
readonly bcallMessage: "bcall";
|
|
186
|
+
readonly lottieStickerMessage: "lottieSticker";
|
|
187
|
+
readonly eventMessage: "event";
|
|
188
|
+
readonly commentMessage: "comment";
|
|
189
|
+
readonly newsletterAdminInviteMessage: "text";
|
|
190
|
+
readonly extendedTextMessageWithParentKey: "text";
|
|
191
|
+
readonly placeholderMessage: "placeholder";
|
|
192
|
+
readonly encEventUpdateMessage: "encEventUpdate";
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export { Actions, Client, Logger, MESSAGE_TYPE, Serialize, type SerializedMessage, bLog, cLog, cache, decodeJid, logBlock, sleep };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as baileys from '@whiskeysockets/baileys';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
+
import NodeCache from 'node-cache';
|
|
4
|
+
import BLog from 'beautify-console-log';
|
|
3
5
|
|
|
4
6
|
declare class Actions extends EventEmitter {
|
|
5
7
|
private client;
|
|
@@ -21,7 +23,51 @@ declare class Actions extends EventEmitter {
|
|
|
21
23
|
groupsUpdate(updates: baileys.BaileysEventMap['groups.update']): void;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Decode a JID
|
|
28
|
+
* @param jid The JID to decode
|
|
29
|
+
* @returns The decoded JID
|
|
30
|
+
*/
|
|
31
|
+
declare const decodeJid: (jid: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Serialize a message
|
|
34
|
+
* @param client The Baileys client
|
|
35
|
+
* @param msg The message to serialize
|
|
36
|
+
* @returns The serialized message
|
|
37
|
+
*/
|
|
38
|
+
declare function Serialize(client: ReturnType<typeof baileys.default>, config: Client, msg: any): SerializedMessage | undefined;
|
|
39
|
+
interface SerializedMessage {
|
|
40
|
+
roomId: string;
|
|
41
|
+
roomType: RoomType;
|
|
42
|
+
senderId: string;
|
|
43
|
+
senderName: string;
|
|
44
|
+
isMe: boolean;
|
|
45
|
+
isBot: boolean;
|
|
46
|
+
isMedia: boolean;
|
|
47
|
+
isEphemeral: boolean;
|
|
48
|
+
isAuthor: boolean;
|
|
49
|
+
msgType: string;
|
|
50
|
+
msgBody: string;
|
|
51
|
+
msgMentions: string[];
|
|
52
|
+
msgExpiration: number;
|
|
53
|
+
msgTimestamp: number;
|
|
54
|
+
msgMedia?: {
|
|
55
|
+
url: string;
|
|
56
|
+
mimetype: string;
|
|
57
|
+
size: number;
|
|
58
|
+
height: number;
|
|
59
|
+
width: number;
|
|
60
|
+
isAnimated: boolean;
|
|
61
|
+
isAvatar: boolean;
|
|
62
|
+
isAiSticker: boolean;
|
|
63
|
+
isLottie: boolean;
|
|
64
|
+
};
|
|
65
|
+
msgQuoted?: SerializedMessage;
|
|
66
|
+
payload(): baileys.WAProto.IWebMessageInfo;
|
|
67
|
+
key(): baileys.WAProto.IMessageKey;
|
|
68
|
+
}
|
|
69
|
+
type RoomType = 'group' | 'private' | 'channel';
|
|
70
|
+
|
|
25
71
|
interface ClientProps {
|
|
26
72
|
phoneNumber: number;
|
|
27
73
|
method: 'pairing' | 'qr';
|
|
@@ -31,12 +77,14 @@ interface ClientProps {
|
|
|
31
77
|
authors?: number[];
|
|
32
78
|
ignoreMe?: boolean;
|
|
33
79
|
}
|
|
34
|
-
declare class Client
|
|
80
|
+
declare class Client {
|
|
35
81
|
private client;
|
|
36
|
-
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private
|
|
82
|
+
private listeners;
|
|
83
|
+
private pino;
|
|
84
|
+
private authPath;
|
|
85
|
+
private credsPath;
|
|
86
|
+
private storePath;
|
|
87
|
+
private logger;
|
|
40
88
|
readonly phoneNumber: number;
|
|
41
89
|
readonly method: 'pairing' | 'qr';
|
|
42
90
|
readonly showLogs: boolean;
|
|
@@ -44,24 +92,104 @@ declare class Client extends EventEmitter {
|
|
|
44
92
|
readonly autoRead: boolean;
|
|
45
93
|
readonly authors: number[];
|
|
46
94
|
readonly ignoreMe: boolean;
|
|
47
|
-
private isRunning;
|
|
48
95
|
constructor(props: ClientProps);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
private
|
|
96
|
+
initialize(): Promise<void>;
|
|
97
|
+
private pairingCode;
|
|
98
|
+
private handler;
|
|
99
|
+
private emit;
|
|
100
|
+
on(event: string, callback: (data: SerializedMessage) => void): void;
|
|
101
|
+
parseMentions(text: any): any;
|
|
102
|
+
send(data: SerializedMessage, text: any): Promise<SerializedMessage | undefined>;
|
|
103
|
+
reply(data: any, text: any): Promise<SerializedMessage | undefined>;
|
|
104
|
+
edit(data: any, target: any, text: any): Promise<SerializedMessage | undefined>;
|
|
105
|
+
reaction(data: any, emoji: any): Promise<SerializedMessage | undefined>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class Logger {
|
|
109
|
+
private bannerLogo;
|
|
110
|
+
private copyright;
|
|
111
|
+
private spinner;
|
|
112
|
+
constructor();
|
|
113
|
+
banner(): void;
|
|
114
|
+
msgLogs(data: SerializedMessage): void;
|
|
115
|
+
runSpinner(text: string): void;
|
|
116
|
+
editSpinner(text: string): void;
|
|
117
|
+
stopSpinner(status: ("succeed" | "fail" | "warn" | "info") | undefined, text: string): void;
|
|
65
118
|
}
|
|
66
119
|
|
|
67
|
-
|
|
120
|
+
declare const bLog: BLog;
|
|
121
|
+
declare const cLog: {
|
|
122
|
+
(...data: any[]): void;
|
|
123
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
124
|
+
};
|
|
125
|
+
declare const cache: NodeCache;
|
|
126
|
+
declare const logBlock: (status?: "succeed" | "fail" | "warn" | "info") => any;
|
|
127
|
+
declare const sleep: (ms: number) => Promise<unknown>;
|
|
128
|
+
|
|
129
|
+
declare const MESSAGE_TYPE: {
|
|
130
|
+
readonly text: "text";
|
|
131
|
+
readonly conversation: "text";
|
|
132
|
+
readonly imageMessage: "image";
|
|
133
|
+
readonly contactMessage: "contact";
|
|
134
|
+
readonly locationMessage: "location";
|
|
135
|
+
readonly extendedTextMessage: "text";
|
|
136
|
+
readonly documentMessage: "document";
|
|
137
|
+
readonly audioMessage: "audio";
|
|
138
|
+
readonly videoMessage: "video";
|
|
139
|
+
readonly protocolMessage: "protocol";
|
|
140
|
+
readonly contactsArrayMessage: "contactsArray";
|
|
141
|
+
readonly highlyStructuredMessage: "highlyStructured";
|
|
142
|
+
readonly sendPaymentMessage: "sendPayment";
|
|
143
|
+
readonly liveLocationMessage: "liveLocation";
|
|
144
|
+
readonly requestPaymentMessage: "requestPayment";
|
|
145
|
+
readonly declinePaymentRequestMessage: "declinePaymentRequest";
|
|
146
|
+
readonly cancelPaymentRequestMessage: "cancelPaymentRequest";
|
|
147
|
+
readonly templateMessage: "template";
|
|
148
|
+
readonly stickerMessage: "sticker";
|
|
149
|
+
readonly groupInviteMessage: "groupInvite";
|
|
150
|
+
readonly templateButtonReplyMessage: "templateButtonReply";
|
|
151
|
+
readonly productMessage: "product";
|
|
152
|
+
readonly deviceSentMessage: "deviceSent";
|
|
153
|
+
readonly listMessage: "list";
|
|
154
|
+
readonly viewOnceMessage: "viewOnce";
|
|
155
|
+
readonly orderMessage: "order";
|
|
156
|
+
readonly listResponseMessage: "listResponse";
|
|
157
|
+
readonly ephemeralMessage: "ephemeral";
|
|
158
|
+
readonly invoiceMessage: "invoice";
|
|
159
|
+
readonly buttonsMessage: "buttons";
|
|
160
|
+
readonly buttonsResponseMessage: "buttonsResponse";
|
|
161
|
+
readonly paymentInviteMessage: "paymentInvite";
|
|
162
|
+
readonly interactiveMessage: "interactive";
|
|
163
|
+
readonly reactionMessage: "reaction";
|
|
164
|
+
readonly stickerSyncRmrMessage: "sticker";
|
|
165
|
+
readonly interactiveResponseMessage: "interactiveResponse";
|
|
166
|
+
readonly pollCreationMessage: "pollCreation";
|
|
167
|
+
readonly pollUpdateMessage: "pollUpdate";
|
|
168
|
+
readonly keepInChatMessage: "keepInChat";
|
|
169
|
+
readonly documentWithCaptionMessage: "document";
|
|
170
|
+
readonly requestPhoneNumberMessage: "requestPhoneNumber";
|
|
171
|
+
readonly viewOnceMessageV2: "viewOnce";
|
|
172
|
+
readonly encReactionMessage: "reaction";
|
|
173
|
+
readonly editedMessage: "text";
|
|
174
|
+
readonly viewOnceMessageV2Extension: "viewOnce";
|
|
175
|
+
readonly pollCreationMessageV2: "pollCreation";
|
|
176
|
+
readonly scheduledCallCreationMessage: "scheduledCallCreation";
|
|
177
|
+
readonly groupMentionedMessage: "groupMentioned";
|
|
178
|
+
readonly pinInChatMessage: "pinInChat";
|
|
179
|
+
readonly pollCreationMessageV3: "pollCreation";
|
|
180
|
+
readonly scheduledCallEditMessage: "scheduledCallEdit";
|
|
181
|
+
readonly ptvMessage: "ptv";
|
|
182
|
+
readonly botInvokeMessage: "botInvoke";
|
|
183
|
+
readonly callLogMesssage: "callLog";
|
|
184
|
+
readonly encCommentMessage: "encComment";
|
|
185
|
+
readonly bcallMessage: "bcall";
|
|
186
|
+
readonly lottieStickerMessage: "lottieSticker";
|
|
187
|
+
readonly eventMessage: "event";
|
|
188
|
+
readonly commentMessage: "comment";
|
|
189
|
+
readonly newsletterAdminInviteMessage: "text";
|
|
190
|
+
readonly extendedTextMessageWithParentKey: "text";
|
|
191
|
+
readonly placeholderMessage: "placeholder";
|
|
192
|
+
readonly encEventUpdateMessage: "encEventUpdate";
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export { Actions, Client, Logger, MESSAGE_TYPE, Serialize, type SerializedMessage, bLog, cLog, cache, decodeJid, logBlock, sleep };
|