zaileys 1.1.40 → 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/dist/index.d.mts CHANGED
@@ -1,45 +1,170 @@
1
- import * as nanospinner from 'nanospinner';
2
1
  import * as baileys from 'baileys';
3
- import baileys__default, { proto, AnyMessageContent } from 'baileys';
4
- import NodeCache from 'node-cache';
5
- import z$2, { z } from 'zod/v4';
6
- import * as zod from 'zod';
7
- import { z as z$1 } from 'zod';
8
- import * as zod_v4_core from 'zod/v4/core';
2
+ import { AuthenticationState, WAMessage, proto, ParticipantAction, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue } from 'baileys';
3
+ import z, { z as z$1 } from 'zod';
4
+ import _ from 'lodash';
9
5
 
10
- interface Store {
11
- read: (id: string) => Promise<unknown>;
12
- write: (obj: Record<string, unknown>) => Promise<void>;
6
+ declare const useAuthState: (folder: string) => Promise<{
7
+ state: AuthenticationState;
8
+ saveCreds: () => Promise<void>;
9
+ }>;
10
+
11
+ declare const SignalType: z.ZodEnum<{
12
+ delete: "delete";
13
+ forward: "forward";
14
+ button: "button";
15
+ edit: "edit";
16
+ }>;
17
+ declare const SignalOptionsType: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
18
+ text: z.ZodString;
19
+ }, z.core.$loose>, z.ZodObject<{
20
+ image: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
21
+ caption: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$loose>, z.ZodObject<{
23
+ audio: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
24
+ caption: z.ZodOptional<z.ZodString>;
25
+ ptt: z.ZodOptional<z.ZodBoolean>;
26
+ }, z.core.$loose>, z.ZodObject<{
27
+ video: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
28
+ caption: z.ZodOptional<z.ZodString>;
29
+ ptv: z.ZodOptional<z.ZodBoolean>;
30
+ }, z.core.$loose>, z.ZodObject<{
31
+ sticker: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
32
+ caption: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$loose>, z.ZodObject<{
34
+ document: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
35
+ caption: z.ZodOptional<z.ZodString>;
36
+ fileName: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$loose>, z.ZodObject<{
38
+ location: z.ZodOptional<z.ZodObject<{
39
+ latitude: z.ZodNumber;
40
+ longitude: z.ZodNumber;
41
+ url: z.ZodOptional<z.ZodURL>;
42
+ title: z.ZodOptional<z.ZodString>;
43
+ footer: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$loose>, z.ZodObject<{
46
+ title: z.ZodOptional<z.ZodString>;
47
+ contacts: z.ZodArray<z.ZodObject<{
48
+ fullname: z.ZodString;
49
+ phoneNumber: z.ZodNumber;
50
+ organization: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ poll: z.ZodObject<{
54
+ name: z.ZodString;
55
+ answers: z.ZodArray<z.ZodString>;
56
+ isMultiple: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strip>]>, z.ZodObject<{
59
+ isViewOnce: z.ZodOptional<z.ZodBoolean>;
60
+ replied: z.ZodOptional<z.ZodCustom<WAMessage, WAMessage>>;
61
+ isForwardedMany: z.ZodOptional<z.ZodBoolean>;
62
+ banner: z.ZodOptional<z.ZodCustom<proto.ContextInfo.IExternalAdReplyInfo, proto.ContextInfo.IExternalAdReplyInfo>>;
63
+ }, z.core.$strip>>]>;
64
+ declare const ButtonOptionsType: z.ZodIntersection<z.ZodObject<{
65
+ text: z.ZodString;
66
+ }, z.core.$loose>, z.ZodObject<{
67
+ buttons: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
68
+ type: z.ZodLiteral<"simple">;
69
+ footer: z.ZodOptional<z.ZodString>;
70
+ data: z.ZodArray<z.ZodObject<{
71
+ id: z.ZodString;
72
+ text: z.ZodString;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ type: z.ZodLiteral<"interactive">;
76
+ footer: z.ZodOptional<z.ZodString>;
77
+ data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
78
+ type: z.ZodLiteral<"quick_reply">;
79
+ text: z.ZodString;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ type: z.ZodLiteral<"cta_url">;
82
+ url: z.ZodURL;
83
+ text: z.ZodString;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ type: z.ZodLiteral<"cta_copy">;
86
+ copy: z.ZodString;
87
+ text: z.ZodString;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ type: z.ZodLiteral<"cta_call">;
90
+ text: z.ZodString;
91
+ phoneNumber: z.ZodString;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ type: z.ZodLiteral<"single_select">;
94
+ text: z.ZodString;
95
+ section: z.ZodArray<z.ZodObject<{
96
+ title: z.ZodString;
97
+ highlight_label: z.ZodOptional<z.ZodString>;
98
+ rows: z.ZodArray<z.ZodObject<{
99
+ id: z.ZodString;
100
+ title: z.ZodString;
101
+ header: z.ZodOptional<z.ZodString>;
102
+ description: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>]>>;
106
+ }, z.core.$strip>]>>;
107
+ isViewOnce: z.ZodOptional<z.ZodBoolean>;
108
+ replied: z.ZodOptional<z.ZodCustom<WAMessage, WAMessage>>;
109
+ isForwardedMany: z.ZodOptional<z.ZodBoolean>;
110
+ }, z.core.$strip>>;
111
+
112
+ declare class Signal {
113
+ protected client: Client;
114
+ constructor(client: Client);
115
+ protected signal(roomId: string, options: z.infer<typeof SignalOptionsType>, type?: z.infer<typeof SignalType>, message?: WAMessage): Promise<WAMessage>;
116
+ send(roomId: string, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
117
+ forward(roomId: string, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
118
+ button(roomId: string, options: z.infer<typeof ButtonOptionsType>): Promise<WAMessage>;
119
+ edit(message: WAMessage, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
120
+ delete(message: WAMessage | WAMessage[]): Promise<WAMessage | (baileys.proto.IWebMessageInfo & {
121
+ key: baileys.WAMessageKey;
122
+ messageStubParameters?: any;
123
+ category?: string;
124
+ retryCount?: number;
125
+ })[]>;
126
+ presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
127
+ reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
13
128
  }
14
- interface JsonDBInterface {
15
- initialize(session: string): Promise<void>;
16
- store(key: string): Store;
17
- upsert(id: string, value: unknown): Promise<void>;
18
- read(id: string): Promise<unknown>;
19
- remove(id: string): Promise<void>;
20
- clear(): Promise<void>;
21
- delete(): Promise<void>;
129
+
130
+ declare class Group {
131
+ protected client: Client;
132
+ constructor(client: Client);
133
+ create(name: string, participants: string[]): Promise<baileys.GroupMetadata>;
134
+ participant(roomId: string, participants: string[], action: ParticipantAction): Promise<{
135
+ status: string;
136
+ jid: string | undefined;
137
+ content: baileys.BinaryNode;
138
+ }[]>;
139
+ profile(roomId: string, update: string | Buffer, type: 'subject' | 'description' | 'picture'): Promise<void>;
140
+ setting(roomId: string, type: 'open' | 'close' | 'locked' | 'unlocked' | 'all_member_add' | 'admin_add'): Promise<void>;
141
+ leave(roomId: string): Promise<void>;
142
+ inviteCode(roomId: string, type: 'code' | 'revoke' | 'accept' | 'info'): Promise<string | baileys.GroupMetadata>;
143
+ metadata(roomId: string): Promise<baileys.GroupMetadata>;
144
+ requestJoin(roomId: string, participants: string[], type: 'approve' | 'reject'): Promise<{
145
+ status: string;
146
+ jid: string | undefined;
147
+ }[]>;
148
+ requestJoinList(roomId: string): Promise<{
149
+ [key: string]: string;
150
+ }[]>;
151
+ fetchAllGroups(): Promise<{
152
+ [_: string]: baileys.GroupMetadata;
153
+ }>;
154
+ ephemeral(roomId: string, type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
22
155
  }
23
- declare class JsonDB implements JsonDBInterface {
24
- private session;
25
- private db;
26
- private storeDir;
27
- initialize(session: string): Promise<void>;
28
- private tryRecoverRaw;
29
- private chunks;
30
- private writeChunks;
31
- store(key: string): Store;
32
- upsert(id: string, value: unknown): Promise<void>;
33
- read(id: string): Promise<any>;
34
- remove(id: string): Promise<void>;
35
- clear(): Promise<void>;
36
- delete(): Promise<void>;
156
+ declare class SignalGroup {
157
+ protected glient: Client;
158
+ group: Group;
159
+ constructor(glient: Client);
37
160
  }
38
161
 
39
- declare const ExtractorCallsType: z.ZodObject<{
162
+ declare const ListenerCallsType: z.ZodObject<{
40
163
  callId: z.ZodString;
41
- roomId: z.ZodString;
42
164
  callerId: z.ZodString;
165
+ callerName: z.ZodString;
166
+ roomId: z.ZodString;
167
+ roomName: z.ZodString;
43
168
  date: z.ZodDate;
44
169
  offline: z.ZodBoolean;
45
170
  status: z.ZodEnum<{
@@ -54,164 +179,30 @@ declare const ExtractorCallsType: z.ZodObject<{
54
179
  isGroup: z.ZodBoolean;
55
180
  }, z.core.$strip>;
56
181
 
57
- declare const ExtractorConnectionType: z.ZodObject<{
182
+ declare const ListenerConnectionType: z.ZodObject<{
58
183
  status: z.ZodEnum<{
59
184
  connecting: "connecting";
60
185
  open: "open";
61
186
  close: "close";
187
+ reload: "reload";
188
+ syncing: "syncing";
189
+ }>;
190
+ authType: z.ZodEnum<{
191
+ pairing: "pairing";
192
+ qr: "qr";
62
193
  }>;
194
+ authTimeout: z.ZodOptional<z.ZodNumber>;
195
+ syncProgress: z.ZodOptional<z.ZodNumber>;
196
+ syncCompleted: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
197
+ qr: z.ZodOptional<z.ZodString>;
198
+ code: z.ZodOptional<z.ZodString>;
63
199
  }, z.core.$strip>;
64
200
 
65
- declare const MessagesMediaType: {
66
- readonly text: "text";
67
- readonly conversation: "text";
68
- readonly imageMessage: "image";
69
- readonly contactMessage: "contact";
70
- readonly locationMessage: "location";
71
- readonly documentMessage: "document";
72
- readonly audioMessage: "audio";
73
- readonly videoMessage: "video";
74
- readonly protocolMessage: "protocol";
75
- readonly contactsArrayMessage: "contacts";
76
- readonly highlyStructuredMessage: "highlyStructured";
77
- readonly sendPaymentMessage: "sendPayment";
78
- readonly liveLocationMessage: "location";
79
- readonly requestPaymentMessage: "requestPayment";
80
- readonly declinePaymentRequestMessage: "declinePaymentRequest";
81
- readonly cancelPaymentRequestMessage: "cancelPaymentRequest";
82
- readonly templateMessage: "template";
83
- readonly stickerMessage: "sticker";
84
- readonly groupInviteMessage: "groupInvite";
85
- readonly templateButtonReplyMessage: "buttons";
86
- readonly productMessage: "product";
87
- readonly deviceSentMessage: "deviceSent";
88
- readonly listMessage: "list";
89
- readonly viewOnceMessage: "viewOnce";
90
- readonly orderMessage: "order";
91
- readonly listResponseMessage: "list";
92
- readonly ephemeralMessage: "ephemeral";
93
- readonly invoiceMessage: "invoice";
94
- readonly buttonsMessage: "buttons";
95
- readonly buttonsResponseMessage: "buttons";
96
- readonly paymentInviteMessage: "paymentInvite";
97
- readonly interactiveMessage: "interactive";
98
- readonly reactionMessage: "reaction";
99
- readonly stickerSyncRmrMessage: "sticker";
100
- readonly interactiveResponseMessage: "interactiveResponse";
101
- readonly pollCreationMessage: "pollCreation";
102
- readonly pollUpdateMessage: "pollUpdate";
103
- readonly keepInChatMessage: "keepInChat";
104
- readonly documentWithCaptionMessage: "document";
105
- readonly requestPhoneNumberMessage: "requestPhoneNumber";
106
- readonly viewOnceMessageV2: "viewOnce";
107
- readonly encReactionMessage: "reaction";
108
- readonly editedMessage: "text";
109
- readonly viewOnceMessageV2Extension: "viewOnce";
110
- readonly pollCreationMessageV2: "pollCreation";
111
- readonly scheduledCallCreationMessage: "scheduledCallCreation";
112
- readonly groupMentionedMessage: "groupMentioned";
113
- readonly pinInChatMessage: "pinInChat";
114
- readonly pollCreationMessageV3: "pollCreation";
115
- readonly scheduledCallEditMessage: "scheduledCallEdit";
116
- readonly ptvMessage: "ptv";
117
- readonly botInvokeMessage: "botInvoke";
118
- readonly callLogMesssage: "callLog";
119
- readonly encCommentMessage: "encComment";
120
- readonly bcallMessage: "bcall";
121
- readonly lottieStickerMessage: "lottieSticker";
122
- readonly eventMessage: "event";
123
- readonly commentMessage: "comment";
124
- readonly newsletterAdminInviteMessage: "text";
125
- readonly extendedTextMessageWithParentKey: "text";
126
- readonly extendedTextMessage: "text";
127
- readonly placeholderMessage: "placeholder";
128
- readonly encEventUpdateMessage: "encEventUpdate";
129
- };
130
- declare const MessagesVerifiedPlatformType: {
131
- readonly whatsapp: "0@s.whatsapp.net";
132
- readonly meta: "13135550002@s.whatsapp.net";
133
- readonly chatgpt: "18002428478@s.whatsapp.net";
134
- readonly copilot: "18772241042@s.whatsapp.net";
135
- readonly instagram: "447723442971@s.whatsapp.net";
136
- readonly tiktok: "6285574670498@s.whatsapp.net";
137
- };
138
- declare const MessagesEnumType: z$1.ZodEnum<{
139
- contacts: "contacts";
140
- event: "event";
141
- text: "text";
142
- image: "image";
143
- contact: "contact";
144
- location: "location";
145
- document: "document";
146
- audio: "audio";
147
- video: "video";
148
- protocol: "protocol";
149
- highlyStructured: "highlyStructured";
150
- sendPayment: "sendPayment";
151
- requestPayment: "requestPayment";
152
- declinePaymentRequest: "declinePaymentRequest";
153
- cancelPaymentRequest: "cancelPaymentRequest";
154
- template: "template";
155
- sticker: "sticker";
156
- groupInvite: "groupInvite";
157
- buttons: "buttons";
158
- product: "product";
159
- deviceSent: "deviceSent";
160
- list: "list";
161
- viewOnce: "viewOnce";
162
- order: "order";
163
- ephemeral: "ephemeral";
164
- invoice: "invoice";
165
- paymentInvite: "paymentInvite";
166
- interactive: "interactive";
167
- reaction: "reaction";
168
- interactiveResponse: "interactiveResponse";
169
- pollCreation: "pollCreation";
170
- pollUpdate: "pollUpdate";
171
- keepInChat: "keepInChat";
172
- requestPhoneNumber: "requestPhoneNumber";
173
- scheduledCallCreation: "scheduledCallCreation";
174
- groupMentioned: "groupMentioned";
175
- pinInChat: "pinInChat";
176
- scheduledCallEdit: "scheduledCallEdit";
177
- ptv: "ptv";
178
- botInvoke: "botInvoke";
179
- callLog: "callLog";
180
- encComment: "encComment";
181
- bcall: "bcall";
182
- lottieSticker: "lottieSticker";
183
- comment: "comment";
184
- placeholder: "placeholder";
185
- encEventUpdate: "encEventUpdate";
186
- }>;
187
- declare const MessagesDeviceEnumType: z$1.ZodEnum<{
188
- unknown: "unknown";
189
- android: "android";
190
- ios: "ios";
191
- desktop: "desktop";
192
- web: "web";
193
- }>;
194
- declare const ExtractorMessagesType: z$1.ZodObject<{
195
- chatId: z$1.ZodString;
196
- channelId: z$1.ZodString;
197
- uniqueId: z$1.ZodString;
198
- receiverId: z$1.ZodString;
199
- receiverName: z$1.ZodString;
200
- roomId: z$1.ZodString;
201
- roomName: z$1.ZodString;
202
- senderLid: z$1.ZodString;
203
- senderId: z$1.ZodString;
204
- senderName: z$1.ZodString;
205
- senderDevice: z$1.ZodEnum<{
206
- unknown: "unknown";
207
- android: "android";
208
- ios: "ios";
209
- desktop: "desktop";
210
- web: "web";
211
- }>;
212
- chatType: z$1.ZodEnum<{
213
- contacts: "contacts";
214
- event: "event";
201
+ declare const ListenerMessagesType: z.ZodObject<{
202
+ channelId: z.ZodString;
203
+ uniqueId: z.ZodString;
204
+ chatId: z.ZodString;
205
+ chatType: z.ZodEnum<{
215
206
  text: "text";
216
207
  image: "image";
217
208
  contact: "contact";
@@ -220,6 +211,7 @@ declare const ExtractorMessagesType: z$1.ZodObject<{
220
211
  audio: "audio";
221
212
  video: "video";
222
213
  protocol: "protocol";
214
+ contacts: "contacts";
223
215
  highlyStructured: "highlyStructured";
224
216
  sendPayment: "sendPayment";
225
217
  requestPayment: "requestPayment";
@@ -228,14 +220,14 @@ declare const ExtractorMessagesType: z$1.ZodObject<{
228
220
  template: "template";
229
221
  sticker: "sticker";
230
222
  groupInvite: "groupInvite";
231
- buttons: "buttons";
232
223
  product: "product";
233
224
  deviceSent: "deviceSent";
234
- list: "list";
225
+ lists: "lists";
235
226
  viewOnce: "viewOnce";
236
227
  order: "order";
237
228
  ephemeral: "ephemeral";
238
229
  invoice: "invoice";
230
+ buttons: "buttons";
239
231
  paymentInvite: "paymentInvite";
240
232
  interactive: "interactive";
241
233
  reaction: "reaction";
@@ -254,530 +246,306 @@ declare const ExtractorMessagesType: z$1.ZodObject<{
254
246
  encComment: "encComment";
255
247
  bcall: "bcall";
256
248
  lottieSticker: "lottieSticker";
249
+ event: "event";
257
250
  comment: "comment";
258
251
  placeholder: "placeholder";
259
252
  encEventUpdate: "encEventUpdate";
260
253
  }>;
261
- timestamp: z$1.ZodNumber;
262
- text: z$1.ZodNullable<z$1.ZodString>;
263
- mentions: z$1.ZodArray<z$1.ZodString>;
264
- links: z$1.ZodArray<z$1.ZodString>;
265
- isPrefix: z$1.ZodBoolean;
266
- isSpam: z$1.ZodBoolean;
267
- isFromMe: z$1.ZodBoolean;
268
- isTagMe: z$1.ZodBoolean;
269
- isGroup: z$1.ZodBoolean;
270
- isStory: z$1.ZodBoolean;
271
- isViewOnce: z$1.ZodBoolean;
272
- isEdited: z$1.ZodBoolean;
273
- isDeleted: z$1.ZodBoolean;
274
- isPinned: z$1.ZodBoolean;
275
- isUnPinned: z$1.ZodBoolean;
276
- isChannel: z$1.ZodBoolean;
277
- isBroadcast: z$1.ZodBoolean;
278
- isEphemeral: z$1.ZodBoolean;
279
- isForwarded: z$1.ZodBoolean;
280
- citation: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodBoolean>>;
281
- media: z$1.ZodNullable<z$1.ZodObject<{
282
- buffer: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
283
- stream: z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.core.$ZodFunctionOut>;
284
- }, z$1.core.$loose>>;
285
- message: z$1.ZodFunction<z$1.ZodTuple<readonly [], null>, z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
286
- replied: z$1.ZodNullable<z$1.ZodObject</*elided*/ any, z$1.core.$strip>>;
287
- }, z$1.core.$strip>;
288
-
289
- type ExtractZod<T> = T extends z.ZodTypeAny ? z.infer<T> : never;
290
- declare const defaultBoolean: (state: boolean) => z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
291
- declare const defaultString: (state: string) => z.ZodOptional<z.ZodDefault<z.ZodString>>;
292
- declare const AdsReplyType: z.ZodCustom<proto.ContextInfo.IExternalAdReplyInfo, proto.ContextInfo.IExternalAdReplyInfo>;
293
-
294
- declare const PluginsType: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
295
- necessary: z$2.ZodString;
296
- }, z$2.core.$loose>>>;
297
- declare const LimiterType: z$2.ZodOptional<z$2.ZodObject<{
298
- durationMs: z$2.ZodNumber;
299
- maxMessages: z$2.ZodNumber;
300
- }, z$2.core.$strip>>;
301
- declare const CitationType: z$2.ZodOptional<z$2.ZodRecord<z$2.ZodString & z$2.core.$partial, z$2.ZodArray<z$2.ZodNumber>>>;
302
- declare const FakeReplyType: z$2.ZodOptional<z$2.ZodObject<{
303
- provider: z$2.ZodEnum<{
304
- whatsapp: "whatsapp";
305
- meta: "meta";
306
- chatgpt: "chatgpt";
307
- copilot: "copilot";
308
- instagram: "instagram";
309
- tiktok: "tiktok";
254
+ receiverId: z.ZodString;
255
+ receiverName: z.ZodString;
256
+ roomId: z.ZodString;
257
+ roomName: z.ZodString;
258
+ senderLid: z.ZodString;
259
+ senderId: z.ZodString;
260
+ senderName: z.ZodString;
261
+ senderDevice: z.ZodEnum<{
262
+ unknown: "unknown";
263
+ android: "android";
264
+ ios: "ios";
265
+ desktop: "desktop";
266
+ web: "web";
310
267
  }>;
311
- }, z$2.core.$strip>>;
312
- declare const ClientBaseType: z$2.ZodObject<{
313
- session: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodString>>;
314
- prefix: z$2.ZodOptional<z$2.ZodString>;
315
- ignoreMe: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
316
- showLogs: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
317
- autoMentions: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
318
- autoOnline: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
319
- autoRead: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
320
- autoPresence: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
321
- autoRejectCall: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
322
- plugins: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
323
- necessary: z$2.ZodString;
324
- }, z$2.core.$loose>>>;
325
- limiter: z$2.ZodOptional<z$2.ZodObject<{
326
- durationMs: z$2.ZodNumber;
327
- maxMessages: z$2.ZodNumber;
328
- }, z$2.core.$strip>>;
329
- citation: z$2.ZodOptional<z$2.ZodRecord<z$2.ZodString & z$2.core.$partial, z$2.ZodArray<z$2.ZodNumber>>>;
330
- fakeReply: z$2.ZodOptional<z$2.ZodObject<{
331
- provider: z$2.ZodEnum<{
332
- whatsapp: "whatsapp";
333
- meta: "meta";
334
- chatgpt: "chatgpt";
335
- copilot: "copilot";
336
- instagram: "instagram";
337
- tiktok: "tiktok";
338
- }>;
339
- }, z$2.core.$strip>>;
340
- }, z$2.core.$strip>;
341
- declare const ClientAuthPairingType: z$2.ZodObject<{
342
- authType: z$2.ZodLiteral<"pairing">;
343
- phoneNumber: z$2.ZodNumber;
344
- }, z$2.core.$strip>;
345
- declare const ClientAuthQRType: z$2.ZodObject<{
346
- authType: z$2.ZodLiteral<"qr">;
347
- }, z$2.core.$strip>;
348
- declare const ClientOptionsType: z$2.ZodDiscriminatedUnion<[z$2.ZodObject<{
349
- authType: z$2.ZodLiteral<"pairing">;
350
- phoneNumber: z$2.ZodNumber;
351
- session: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodString>>;
352
- prefix: z$2.ZodOptional<z$2.ZodString>;
353
- ignoreMe: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
354
- showLogs: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
355
- autoMentions: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
356
- autoOnline: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
357
- autoRead: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
358
- autoPresence: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
359
- autoRejectCall: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
360
- plugins: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
361
- necessary: z$2.ZodString;
362
- }, z$2.core.$loose>>>;
363
- limiter: z$2.ZodOptional<z$2.ZodObject<{
364
- durationMs: z$2.ZodNumber;
365
- maxMessages: z$2.ZodNumber;
366
- }, z$2.core.$strip>>;
367
- citation: z$2.ZodOptional<z$2.ZodRecord<z$2.ZodString & z$2.core.$partial, z$2.ZodArray<z$2.ZodNumber>>>;
368
- fakeReply: z$2.ZodOptional<z$2.ZodObject<{
369
- provider: z$2.ZodEnum<{
268
+ timestamp: z.ZodNumber;
269
+ text: z.ZodNullable<z.ZodString>;
270
+ mentions: z.ZodArray<z.ZodString>;
271
+ links: z.ZodArray<z.ZodString>;
272
+ isBot: z.ZodBoolean;
273
+ isFromMe: z.ZodBoolean;
274
+ isPrefix: z.ZodBoolean;
275
+ isSpam: z.ZodBoolean;
276
+ isTagMe: z.ZodBoolean;
277
+ isGroup: z.ZodBoolean;
278
+ isNewsletter: z.ZodBoolean;
279
+ isQuestion: z.ZodBoolean;
280
+ isStory: z.ZodBoolean;
281
+ isViewOnce: z.ZodBoolean;
282
+ isEdited: z.ZodBoolean;
283
+ isDeleted: z.ZodBoolean;
284
+ isPinned: z.ZodBoolean;
285
+ isUnPinned: z.ZodBoolean;
286
+ isBroadcast: z.ZodBoolean;
287
+ isEphemeral: z.ZodBoolean;
288
+ isForwarded: z.ZodBoolean;
289
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>>;
290
+ media: z.ZodNullable<z.ZodObject<{
291
+ buffer: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
292
+ stream: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
293
+ }, z.core.$loose>>;
294
+ message: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodCustom<WAMessage, WAMessage>>;
295
+ replied: z.ZodNullable<z.ZodObject</*elided*/ any, z.core.$strip>>;
296
+ }, z.core.$strip>;
297
+
298
+ declare const StickerMetadataType: z$1.ZodOptional<z$1.ZodObject<{
299
+ packageName: z$1.ZodString;
300
+ authorName: z$1.ZodString;
301
+ quality: z$1.ZodNumber;
302
+ }, z$1.core.$strip>>;
303
+ declare const ClientOptionsType: z$1.ZodUnion<readonly [z$1.ZodObject<{
304
+ authType: z$1.ZodLiteral<"pairing">;
305
+ phoneNumber: z$1.ZodNumber;
306
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
307
+ prefix: z$1.ZodOptional<z$1.ZodString>;
308
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
309
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
310
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
311
+ autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
312
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
313
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
314
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
315
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
316
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
317
+ limiter: z$1.ZodOptional<z$1.ZodObject<{
318
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
319
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
320
+ }, z$1.core.$strip>>;
321
+ citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
322
+ fakeReply: z$1.ZodOptional<z$1.ZodObject<{
323
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
370
324
  whatsapp: "whatsapp";
371
325
  meta: "meta";
372
326
  chatgpt: "chatgpt";
373
327
  copilot: "copilot";
374
328
  instagram: "instagram";
375
329
  tiktok: "tiktok";
376
- }>;
377
- }, z$2.core.$strip>>;
378
- }, z$2.core.$strip>, z$2.ZodObject<{
379
- authType: z$2.ZodLiteral<"qr">;
380
- session: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodString>>;
381
- prefix: z$2.ZodOptional<z$2.ZodString>;
382
- ignoreMe: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
383
- showLogs: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
384
- autoMentions: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
385
- autoOnline: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
386
- autoRead: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
387
- autoPresence: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
388
- autoRejectCall: z$2.ZodOptional<z$2.ZodDefault<z$2.ZodBoolean>>;
389
- plugins: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
390
- necessary: z$2.ZodString;
391
- }, z$2.core.$loose>>>;
392
- limiter: z$2.ZodOptional<z$2.ZodObject<{
393
- durationMs: z$2.ZodNumber;
394
- maxMessages: z$2.ZodNumber;
395
- }, z$2.core.$strip>>;
396
- citation: z$2.ZodOptional<z$2.ZodRecord<z$2.ZodString & z$2.core.$partial, z$2.ZodArray<z$2.ZodNumber>>>;
397
- fakeReply: z$2.ZodOptional<z$2.ZodObject<{
398
- provider: z$2.ZodEnum<{
330
+ }>, z$1.ZodNumber]>;
331
+ }, z$1.core.$strip>>;
332
+ sticker: z$1.ZodOptional<z$1.ZodObject<{
333
+ packageName: z$1.ZodString;
334
+ authorName: z$1.ZodString;
335
+ quality: z$1.ZodNumber;
336
+ }, z$1.core.$strip>>;
337
+ }, z$1.core.$strip>, z$1.ZodObject<{
338
+ authType: z$1.ZodLiteral<"qr">;
339
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
340
+ prefix: z$1.ZodOptional<z$1.ZodString>;
341
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
342
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
343
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
344
+ autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
345
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
346
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
347
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
348
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
349
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
350
+ limiter: z$1.ZodOptional<z$1.ZodObject<{
351
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
352
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
353
+ }, z$1.core.$strip>>;
354
+ citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
355
+ fakeReply: z$1.ZodOptional<z$1.ZodObject<{
356
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
399
357
  whatsapp: "whatsapp";
400
358
  meta: "meta";
401
359
  chatgpt: "chatgpt";
402
360
  copilot: "copilot";
403
361
  instagram: "instagram";
404
362
  tiktok: "tiktok";
405
- }>;
406
- }, z$2.core.$strip>>;
407
- }, z$2.core.$strip>], "authType">;
408
- declare const EventEnumType: z$2.ZodEnum<{
363
+ }>, z$1.ZodNumber]>;
364
+ }, z$1.core.$strip>>;
365
+ sticker: z$1.ZodOptional<z$1.ZodObject<{
366
+ packageName: z$1.ZodString;
367
+ authorName: z$1.ZodString;
368
+ quality: z$1.ZodNumber;
369
+ }, z$1.core.$strip>>;
370
+ }, z$1.core.$strip>]>;
371
+ declare const EventEnumType: z$1.ZodEnum<{
409
372
  connection: "connection";
410
373
  messages: "messages";
411
374
  calls: "calls";
412
- webhooks: "webhooks";
413
375
  }>;
414
376
  type EventCallbackType = {
415
- connection: (ctx: ExtractZod<typeof ExtractorConnectionType>) => void;
416
- messages: (ctx: ExtractZod<typeof ExtractorMessagesType>) => void;
417
- calls: (ctx: ExtractZod<typeof ExtractorCallsType>) => void;
418
- webhooks: (ctx: ExtractZod<typeof EventEnumType>) => void;
377
+ connection: (ctx: z$1.infer<typeof ListenerConnectionType>) => void;
378
+ messages: (ctx: z$1.infer<typeof ListenerMessagesType>) => void;
379
+ calls: (ctx: z$1.infer<typeof ListenerCallsType>) => void;
419
380
  };
420
381
 
421
- declare const RelayTextType: z.ZodUnion<[z.ZodString, z.ZodObject<{
422
- text: z.ZodString;
423
- roomId: z.ZodOptional<z.ZodString>;
424
- options: z.ZodOptional<z.ZodCustom<AnyMessageContent, AnyMessageContent>>;
425
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
426
- }, z.core.$strip>]>;
427
-
428
- declare const RelayReplyType: z.ZodUnion<[z.ZodString, z.ZodObject<{
429
- text: z.ZodString;
430
- roomId: z.ZodOptional<z.ZodString>;
431
- options: z.ZodOptional<z.ZodCustom<AnyMessageContent, AnyMessageContent>>;
432
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
433
- }, z.core.$strip>]>;
434
-
435
- declare const RelayForwardType: z.ZodUnion<[z.ZodString, z.ZodObject<{
436
- text: z.ZodString;
437
- isForwardMany: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
438
- roomId: z.ZodOptional<z.ZodString>;
439
- options: z.ZodOptional<z.ZodCustom<AnyMessageContent, AnyMessageContent>>;
440
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
441
- }, z.core.$strip>]>;
442
-
443
- declare const RelayImageEnumType: z.ZodEnum<{
444
- text: "text";
445
- reply: "reply";
446
- forward: "forward";
447
- }>;
448
- declare const RelayImageType: z.ZodObject<{
449
- image: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
450
- text: z.ZodOptional<z.ZodString>;
451
- viewOnce: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
452
- roomId: z.ZodOptional<z.ZodString>;
453
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
454
- }, z.core.$strip>;
455
-
456
- declare const RelayVideoEnumType: z.ZodEnum<{
457
- text: "text";
458
- reply: "reply";
459
- forward: "forward";
460
- }>;
461
- declare const RelayVideoType: z.ZodObject<{
462
- video: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
463
- text: z.ZodOptional<z.ZodString>;
464
- viewOnce: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
465
- roomId: z.ZodOptional<z.ZodString>;
466
- }, z.core.$strip>;
467
-
468
- declare const RelayAudioEnumType: z.ZodEnum<{
469
- text: "text";
470
- reply: "reply";
471
- forward: "forward";
472
- }>;
473
- declare const RelayAudioType: z.ZodObject<{
474
- audio: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
475
- viewOnce: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
476
- roomId: z.ZodOptional<z.ZodString>;
477
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
478
- }, z.core.$strip>;
479
-
480
- declare const RelayStickerEnumType: z.ZodEnum<{
481
- text: "text";
482
- reply: "reply";
483
- forward: "forward";
484
- }>;
485
- declare const RelayStickerType: z.ZodObject<{
486
- sticker: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
487
- roomId: z.ZodOptional<z.ZodString>;
488
- }, z.core.$strip>;
489
-
490
- declare const RelayEditType: z.ZodObject<{
491
- text: z.ZodString;
492
- message: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodAny>>;
493
- }, z.core.$strip>;
494
-
495
- declare const RelayDeleteType: z.ZodObject<{
496
- message: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodAny>>;
497
- }, z.core.$strip>;
498
-
499
- declare const RelayRejectType: zod.ZodObject<{
500
- callId: zod.ZodString;
501
- callerId: zod.ZodString;
502
- }, zod_v4_core.$strip>;
503
-
504
- declare const RelayPresenceType: z.ZodEnum<{
505
- offline: "offline";
506
- typing: "typing";
507
- recording: "recording";
508
- online: "online";
509
- paused: "paused";
510
- }>;
511
-
512
- declare const RelayReactionType: z.ZodUnion<[z.ZodEmoji, z.ZodObject<{
513
- emoticon: z.ZodEmoji;
514
- message: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodAny>>;
515
- }, z.core.$strip>]>;
516
-
517
- declare const RelayLocationEnumType: z.ZodEnum<{
518
- text: "text";
519
- reply: "reply";
520
- forward: "forward";
521
- }>;
522
- declare const RelayLocationType: z.ZodObject<{
523
- latitude: z.ZodNumber;
524
- longitude: z.ZodNumber;
525
- title: z.ZodOptional<z.ZodString>;
526
- footer: z.ZodOptional<z.ZodString>;
527
- roomId: z.ZodOptional<z.ZodString>;
528
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
529
- }, z.core.$strip>;
530
-
531
- declare const RelayContactEnumType: z.ZodEnum<{
532
- text: "text";
533
- reply: "reply";
534
- forward: "forward";
535
- }>;
536
- declare const RelayContactType: z.ZodObject<{
537
- title: z.ZodOptional<z.ZodString>;
538
- contacts: z.ZodArray<z.ZodObject<{
539
- fullname: z.ZodString;
540
- nickname: z.ZodOptional<z.ZodString>;
541
- organization: z.ZodOptional<z.ZodString>;
542
- phoneNumber: z.ZodNumber;
543
- website: z.ZodOptional<z.ZodURL>;
544
- }, z.core.$strip>>;
545
- roomId: z.ZodOptional<z.ZodString>;
546
- }, z.core.$strip>;
547
-
548
- declare const RelayPollEnumType: z.ZodEnum<{
549
- text: "text";
550
- reply: "reply";
551
- forward: "forward";
552
- }>;
553
- declare const RelayPollType: z.ZodDiscriminatedUnion<[z.ZodObject<{
554
- action: z.ZodLiteral<"create">;
555
- name: z.ZodString;
556
- answers: z.ZodArray<z.ZodString>;
557
- isMultiple: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
558
- roomId: z.ZodOptional<z.ZodString>;
559
- }, z.core.$strip>], "action">;
560
-
561
- declare const RelayDocumentEnumType: z.ZodEnum<{
562
- text: "text";
563
- reply: "reply";
564
- forward: "forward";
565
- }>;
566
- declare const RelayDocumentType: z.ZodObject<{
567
- document: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
568
- mimetype: z.ZodString;
569
- text: z.ZodOptional<z.ZodString>;
570
- fileName: z.ZodOptional<z.ZodString>;
571
- roomId: z.ZodOptional<z.ZodString>;
572
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
573
- }, z.core.$strip>;
574
-
575
- declare const RelayButtonEnumType: z.ZodEnum<{
576
- text: "text";
577
- reply: "reply";
578
- forward: "forward";
579
- }>;
580
- declare const RelayButtonType: z.ZodDiscriminatedUnion<[z.ZodObject<{
581
- type: z.ZodLiteral<"simple">;
582
- text: z.ZodString;
583
- footer: z.ZodOptional<z.ZodString>;
584
- buttons: z.ZodArray<z.ZodObject<{
585
- id: z.ZodString;
586
- text: z.ZodString;
587
- }, z.core.$strip>>;
588
- roomId: z.ZodOptional<z.ZodString>;
589
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
590
- }, z.core.$strip>, z.ZodObject<{
591
- type: z.ZodLiteral<"interactive">;
592
- text: z.ZodString;
593
- footer: z.ZodOptional<z.ZodString>;
594
- buttons: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
595
- type: z.ZodLiteral<"quick_reply">;
596
- id: z.ZodString;
597
- text: z.ZodString;
598
- }, z.core.$strip>, z.ZodObject<{
599
- type: z.ZodLiteral<"cta_url">;
600
- id: z.ZodString;
601
- url: z.ZodURL;
602
- text: z.ZodString;
603
- }, z.core.$strip>, z.ZodObject<{
604
- type: z.ZodLiteral<"cta_copy">;
605
- id: z.ZodString;
606
- copy: z.ZodString;
607
- text: z.ZodString;
608
- }, z.core.$strip>, z.ZodObject<{
609
- type: z.ZodLiteral<"cta_call">;
610
- id: z.ZodString;
611
- phoneNumber: z.ZodString;
612
- text: z.ZodString;
613
- }, z.core.$strip>], "type">>;
614
- roomId: z.ZodOptional<z.ZodString>;
615
- externalAdReply: z.ZodOptional<z.ZodCustom<baileys.proto.ContextInfo.IExternalAdReplyInfo, baileys.proto.ContextInfo.IExternalAdReplyInfo>>;
616
- }, z.core.$strip>], "type">;
617
-
618
- declare const RelayGroupCreateType: z.ZodObject<{
619
- title: z.ZodString;
620
- members: z.ZodArray<z.ZodString>;
621
- }, z.core.$strip>;
622
-
623
- declare const RelayGroupActionType: z.ZodObject<{
624
- roomId: z.ZodString;
625
- action: z.ZodEnum<{
626
- add: "add";
627
- kick: "kick";
628
- promote: "promote";
629
- demote: "demote";
630
- }>;
631
- members: z.ZodArray<z.ZodString>;
632
- }, z.core.$strip>;
382
+ type ParsedMessage = Partial<z.infer<typeof ListenerMessagesType>>;
383
+ type CollectorFilter = (msg: ParsedMessage) => boolean;
384
+ type CollectorCallback = (messages: ParsedMessage[]) => void;
385
+ interface CollectorOptions {
386
+ filter?: CollectorFilter;
387
+ timeout: number;
388
+ max?: number;
389
+ }
390
+ declare class MessageCollector {
391
+ collect(channelId: string, options: CollectorOptions, callback: CollectorCallback): void;
392
+ push(msg: ParsedMessage): boolean;
393
+ has(channelId: string): boolean;
394
+ cancel(channelId: string): ParsedMessage[];
395
+ }
633
396
 
634
- declare const RelayGroupUpdateType: z.ZodObject<{
635
- roomId: z.ZodString;
636
- text: z.ZodString;
637
- action: z.ZodEnum<{
638
- subject: "subject";
639
- description: "description";
640
- }>;
641
- }, z.core.$strip>;
397
+ declare class Logs {
398
+ private client;
399
+ private ready;
400
+ constructor(client: Client);
401
+ getRoomColor(validator: any): "lime" | "orange" | "#383838ff" | "blue";
402
+ initialize(): void;
403
+ message(message: Partial<z.infer<typeof ListenerMessagesType>>): void;
404
+ call(call: Partial<z.infer<typeof ListenerCallsType>>): void;
405
+ }
642
406
 
643
- declare const RelayGroupSettingsType: z.ZodObject<{
644
- roomId: z.ZodString;
645
- action: z.ZodEnum<{
646
- open: "open";
647
- close: "close";
648
- lock: "lock";
649
- unlock: "unlock";
650
- }>;
651
- }, z.core.$strip>;
407
+ type MiddlewareContextType = {
408
+ messages?: Partial<z.infer<typeof ListenerMessagesType>>;
409
+ calls?: Partial<z.infer<typeof ListenerCallsType>>;
410
+ };
652
411
 
653
- declare const RelayGroupLeaveType: z.ZodObject<{
654
- roomId: z.ZodString;
655
- }, z.core.$strip>;
412
+ type MiddlewareNext = () => Promise<void> | void;
413
+ type MiddlewareHandler<T> = (ctx: MiddlewareContextType, next: MiddlewareNext) => Promise<void> | void;
414
+ declare class Middleware<T> {
415
+ private stack;
416
+ use(handler: MiddlewareHandler<T>): this;
417
+ run(ctx: MiddlewareContextType): Promise<void>;
418
+ }
656
419
 
657
- declare const RelayGroupLinksType: z.ZodObject<{
658
- roomId: z.ZodString;
659
- action: z.ZodEnum<{
660
- get: "get";
661
- revoke: "revoke";
420
+ type PluginsHandlerType = (wa: Client, ctx: MiddlewareContextType) => Promise<void> | void;
421
+ type PluginsConfigType = {
422
+ matcher: string[];
423
+ metadata?: Record<string, any>;
424
+ };
425
+ type PluginDefinition = {
426
+ handler: PluginsHandlerType;
427
+ config: PluginsConfigType;
428
+ };
429
+ declare class Plugins {
430
+ private plugins;
431
+ private pluginsDir;
432
+ constructor(pluginsDir?: string);
433
+ load(): Promise<void>;
434
+ execute(wa: Client, ctx: MiddlewareContextType): Promise<void>;
435
+ private match;
436
+ getLoadedPlugins(): PluginDefinition[];
437
+ getPluginsInfo(): {
438
+ matcher: string[];
439
+ metadata?: Record<string, any>;
440
+ }[];
441
+ reload(): Promise<void>;
442
+ }
443
+ declare const definePlugins: (handler: PluginsHandlerType, config: PluginsConfigType) => PluginDefinition;
444
+
445
+ declare class Privacy {
446
+ protected client: Client;
447
+ constructor(client: Client);
448
+ block(senderId: string): Promise<void>;
449
+ unblock(senderId: string): Promise<void>;
450
+ lastSeen(type: WAPrivacyValue): Promise<void>;
451
+ online(type: WAPrivacyOnlineValue): Promise<void>;
452
+ picture(type: WAPrivacyValue): Promise<void>;
453
+ status(type: WAPrivacyValue): Promise<void>;
454
+ readReceipt(type: WAReadReceiptsValue): Promise<void>;
455
+ groupsAdd(type: WAPrivacyGroupAddValue): Promise<void>;
456
+ ephemeral(type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
457
+ blocklist(): Promise<string[]>;
458
+ getSettings(): Promise<{
459
+ [_: string]: string;
662
460
  }>;
663
- }, z.core.$strip>;
461
+ }
462
+ declare class SignalPrivacy {
463
+ protected plient: Client;
464
+ privacy: Privacy;
465
+ constructor(plient: Client);
466
+ }
664
467
 
665
- declare const RelayGroupInviteType: z.ZodObject<{
666
- url: z.ZodURL;
667
- action: z.ZodEnum<{
668
- join: "join";
669
- info: "info";
468
+ declare class Newsletter {
469
+ protected client: Client;
470
+ constructor(client: Client);
471
+ create(name: string, description: string): Promise<baileys.NewsletterMetadata>;
472
+ action(roomId: string, type: 'follow' | 'unfollow' | 'mute' | 'unmute' | ''): Promise<unknown>;
473
+ update(roomId: string, update: string | Buffer, type: 'name' | 'description' | 'picture'): Promise<unknown>;
474
+ metadata(roomId: string, type: 'invite' | 'jid'): Promise<baileys.NewsletterMetadata>;
475
+ subscribers(roomId: string): Promise<{
476
+ subscribers: number;
670
477
  }>;
671
- }, z.core.$strip>;
672
-
673
- declare const RelayGroupRequestsListType: z.ZodObject<{
674
- roomId: z.ZodString;
675
- }, z.core.$strip>;
676
- declare const RelayGroupRequestsApproveType: z.ZodObject<{
677
- roomId: z.ZodString;
678
- members: z.ZodArray<z.ZodString>;
679
- }, z.core.$strip>;
680
- declare const RelayGroupRequestsRejectType: z.ZodObject<{
681
- roomId: z.ZodString;
682
- members: z.ZodArray<z.ZodString>;
683
- }, z.core.$strip>;
684
-
685
- declare const RelayGroupMetadataType: z.ZodObject<{
686
- roomId: z.ZodString;
687
- }, z.core.$strip>;
478
+ reaction(roomId: string, chatId: string, reaction: string): Promise<void>;
479
+ fetchMessages(roomId: string, count: number, since: Date, after: Date): Promise<any>;
480
+ adminCount(roomId: string): Promise<number>;
481
+ changeOwner(roomId: string, owner: string): Promise<void>;
482
+ demote(roomId: string, senderId: string): Promise<void>;
483
+ delete(roomId: string): Promise<void>;
484
+ removePicture(roomId: string): Promise<unknown>;
485
+ }
486
+ declare class SignalNewsletter {
487
+ protected nlient: Client;
488
+ newsletter: Newsletter;
489
+ constructor(nlient: Client);
490
+ }
688
491
 
689
- declare const RelayPrivacyUpdateType: z.ZodDiscriminatedUnion<[z.ZodObject<{
690
- action: z.ZodLiteral<"control">;
691
- type: z.ZodEnum<{
692
- block: "block";
693
- unblock: "unblock";
694
- }>;
695
- senderId: z.ZodString;
696
- }, z.core.$strip>, z.ZodObject<{
697
- action: z.ZodLiteral<"lastSeen">;
698
- type: z.ZodEnum<{
699
- contacts: "contacts";
700
- all: "all";
701
- contact_blacklist: "contact_blacklist";
702
- none: "none";
703
- }>;
704
- }, z.core.$strip>, z.ZodObject<{
705
- action: z.ZodLiteral<"online">;
706
- type: z.ZodEnum<{
707
- all: "all";
708
- match_last_seen: "match_last_seen";
709
- }>;
710
- }, z.core.$strip>, z.ZodObject<{
711
- action: z.ZodLiteral<"avatar">;
712
- type: z.ZodEnum<{
713
- contacts: "contacts";
714
- all: "all";
715
- contact_blacklist: "contact_blacklist";
716
- none: "none";
717
- }>;
718
- }, z.core.$strip>, z.ZodObject<{
719
- action: z.ZodLiteral<"story">;
720
- type: z.ZodEnum<{
721
- contacts: "contacts";
722
- all: "all";
723
- contact_blacklist: "contact_blacklist";
724
- none: "none";
725
- }>;
726
- }, z.core.$strip>, z.ZodObject<{
727
- action: z.ZodLiteral<"read">;
728
- type: z.ZodEnum<{
729
- all: "all";
730
- none: "none";
731
- }>;
732
- }, z.core.$strip>, z.ZodObject<{
733
- action: z.ZodLiteral<"groupsAdd">;
734
- type: z.ZodEnum<{
735
- contacts: "contacts";
736
- all: "all";
737
- contact_blacklist: "contact_blacklist";
492
+ declare class Community {
493
+ protected client: Client;
494
+ constructor(client: Client);
495
+ create(subject: string, description: string): Promise<baileys.GroupMetadata>;
496
+ createGroup(subject: string, participants: string[], parentId: string): Promise<baileys.GroupMetadata>;
497
+ leave(id: string): Promise<void>;
498
+ metadata(id: string): Promise<baileys.GroupMetadata>;
499
+ update(id: string, type: 'subject' | 'description', value: string): Promise<void>;
500
+ group(id: string, type: 'link' | 'unlink' | 'linked', groupJid?: string): Promise<void | {
501
+ communityJid: string;
502
+ isCommunity: boolean;
503
+ linkedGroups: {
504
+ id: string | undefined;
505
+ subject: string;
506
+ creation: number | undefined;
507
+ owner: string | undefined;
508
+ size: number | undefined;
509
+ }[];
738
510
  }>;
739
- }, z.core.$strip>, z.ZodObject<{
740
- action: z.ZodLiteral<"ephemeral">;
741
- type: z.ZodEnum<{
742
- remove: "remove";
743
- "24h": "24h";
744
- "7d": "7d";
745
- "90d": "90d";
746
- }>;
747
- }, z.core.$strip>], "action">;
748
-
749
- declare const RelayProfileBioType: z.ZodObject<{
750
- senderId: z.ZodString;
751
- }, z.core.$strip>;
752
-
753
- declare const RelayProfileUpdateType: z.ZodObject<{
754
- type: z.ZodEnum<{
755
- name: "name";
756
- avatar: "avatar";
757
- bio: "bio";
511
+ participants(id: string, type: 'list' | 'request-update' | 'update' | 'all', action?: 'add' | 'remove' | 'promote' | 'demote' | 'approve' | 'reject', participants?: string[]): Promise<{
512
+ [key: string]: string;
513
+ }[] | {
514
+ status: string;
515
+ jid: string | undefined;
516
+ }[] | {
517
+ [_: string]: baileys.GroupMetadata;
758
518
  }>;
759
- text: z.ZodOptional<z.ZodString>;
760
- roomId: z.ZodOptional<z.ZodString>;
761
- avatar: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>, z.ZodLiteral<"remove">]>;
762
- }, z.core.$strip>;
763
-
764
- declare const RelayProfileCheckType: z.ZodObject<{
765
- senderId: z.ZodString;
766
- }, z.core.$strip>;
519
+ invite(target: string | any, type: 'code' | 'revoke' | 'accept' | 'info' | 'revokeV4' | 'acceptV4', ...args: any[]): Promise<any>;
520
+ settings(id: string, type: 'ephemeral' | 'update' | 'memberAdd' | 'approval', value?: any): Promise<void>;
521
+ }
522
+ declare class SignalCommunity {
523
+ protected mlient: Client;
524
+ community: Community;
525
+ constructor(mlient: Client);
526
+ }
767
527
 
768
- declare class Relay {
769
- private client;
770
- private message;
771
- db: JsonDBInterface;
772
- ctx: Client & {
773
- db: JsonDBInterface;
774
- };
775
- bind(client: Client, db: JsonDBInterface): void;
776
- private initial;
777
- text(props: ExtractZod<typeof RelayTextType>): Promise<{
778
- chatId: string;
528
+ interface Client extends Signal, SignalGroup, SignalPrivacy, SignalNewsletter, SignalCommunity {
529
+ }
530
+ declare class Client {
531
+ options: z.infer<typeof ClientOptionsType>;
532
+ private listener;
533
+ private _ready;
534
+ logs: Logs;
535
+ collector: MessageCollector;
536
+ middleware: Middleware<any>;
537
+ plugins: Plugins;
538
+ constructor(options: z.infer<typeof ClientOptionsType>);
539
+ initialize(): Promise<void>;
540
+ ready(): Promise<void>;
541
+ db(path: string): Lowdb;
542
+ on<T extends z.infer<typeof EventEnumType>>(event: T, handler: EventCallbackType[T]): void;
543
+ use<T>(handler: MiddlewareHandler<T>): this;
544
+ getMessageByChatId(chatId: string): Promise<Partial<{
779
545
  channelId: string;
780
546
  uniqueId: string;
547
+ chatId: string;
548
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contacts" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "product" | "deviceSent" | "lists" | "viewOnce" | "order" | "ephemeral" | "invoice" | "buttons" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
781
549
  receiverId: string;
782
550
  receiverName: string;
783
551
  roomId: string;
@@ -786,37 +554,39 @@ declare class Relay {
786
554
  senderId: string;
787
555
  senderName: string;
788
556
  senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
789
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
790
557
  timestamp: number;
791
558
  mentions: string[];
792
559
  links: string[];
560
+ isBot: boolean;
561
+ isFromMe: boolean;
793
562
  isPrefix: boolean;
794
563
  isSpam: boolean;
795
- isFromMe: boolean;
796
564
  isTagMe: boolean;
797
565
  isGroup: boolean;
566
+ isNewsletter: boolean;
567
+ isQuestion: boolean;
798
568
  isStory: boolean;
799
569
  isViewOnce: boolean;
800
570
  isEdited: boolean;
801
571
  isDeleted: boolean;
802
572
  isPinned: boolean;
803
573
  isUnPinned: boolean;
804
- isChannel: boolean;
805
574
  isBroadcast: boolean;
806
575
  isEphemeral: boolean;
807
576
  isForwarded: boolean;
808
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
577
+ message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodCustom<baileys.WAMessage, baileys.WAMessage>>;
809
578
  text?: string;
810
- citation?: Record<string, boolean>;
579
+ citation?: Record<string, z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>;
811
580
  media?: {
812
581
  [x: string]: unknown;
813
582
  buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
814
583
  stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
815
584
  };
816
585
  replied?: {
817
- chatId: string;
818
586
  channelId: string;
819
587
  uniqueId: string;
588
+ chatId: string;
589
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contacts" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "product" | "deviceSent" | "lists" | "viewOnce" | "order" | "ephemeral" | "invoice" | "buttons" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
820
590
  receiverId: string;
821
591
  receiverName: string;
822
592
  roomId: string;
@@ -825,28 +595,29 @@ declare class Relay {
825
595
  senderId: string;
826
596
  senderName: string;
827
597
  senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
828
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
829
598
  timestamp: number;
830
599
  mentions: string[];
831
600
  links: string[];
601
+ isBot: boolean;
602
+ isFromMe: boolean;
832
603
  isPrefix: boolean;
833
604
  isSpam: boolean;
834
- isFromMe: boolean;
835
605
  isTagMe: boolean;
836
606
  isGroup: boolean;
607
+ isNewsletter: boolean;
608
+ isQuestion: boolean;
837
609
  isStory: boolean;
838
610
  isViewOnce: boolean;
839
611
  isEdited: boolean;
840
612
  isDeleted: boolean;
841
613
  isPinned: boolean;
842
614
  isUnPinned: boolean;
843
- isChannel: boolean;
844
615
  isBroadcast: boolean;
845
616
  isEphemeral: boolean;
846
617
  isForwarded: boolean;
847
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
618
+ message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodCustom<baileys.WAMessage, baileys.WAMessage>>;
848
619
  text?: string;
849
- citation?: Record<string, boolean>;
620
+ citation?: Record<string, z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>;
850
621
  media?: {
851
622
  [x: string]: unknown;
852
623
  buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
@@ -854,594 +625,111 @@ declare class Relay {
854
625
  };
855
626
  replied?: /*elided*/ any;
856
627
  };
628
+ }>>;
629
+ getRoomName(roomId: string): Promise<string>;
630
+ }
631
+
632
+ declare const registerAuthCreds: (client: Client) => Promise<void>;
633
+
634
+ type FlushMode = 'manual' | 'sync' | 'debounce';
635
+ declare class Lowdb {
636
+ private data;
637
+ private path;
638
+ private pool;
639
+ private size;
640
+ private chunkDir;
641
+ private replacer;
642
+ private reviver;
643
+ private loaded;
644
+ private flushMode;
645
+ private debounceMs;
646
+ private flushTimer;
647
+ private dirty;
648
+ constructor(path: string, bufferJSON?: any, size?: number, flushMode?: FlushMode, debounceMs?: number);
649
+ private ensureLoaded;
650
+ private scheduleFlush;
651
+ read(): Promise<Map<string, any>>;
652
+ write(): Promise<void>;
653
+ set<T>(key: string, value: T): Promise<void>;
654
+ push<T>(key: string, value: T): Promise<void>;
655
+ get(key?: string | object): Promise<any>;
656
+ all(): Promise<any>;
657
+ delete(key: string): Promise<boolean>;
658
+ private saveChunk;
659
+ private loadChunk;
660
+ private delChunk;
661
+ private isMeta;
662
+ }
663
+ declare const createLowdb: (path: string, options?: {
664
+ BufferJSON?: any;
665
+ size?: number;
666
+ flushMode?: FlushMode;
667
+ debounceMs?: number;
668
+ }) => Lowdb;
669
+
670
+ declare const ignoreLint: (data: any) => any;
671
+ declare const getLatestLibVersion: () => Promise<any>;
672
+ declare const removeAuthCreds: (session: string) => Promise<void>;
673
+ declare const normalizeText: (text?: string) => string;
674
+
675
+ declare const logColor: (text: string, color?: string[] | string) => string;
676
+ declare const toJson: (object: unknown) => any;
677
+ declare const toString: (object: unknown) => string;
678
+ declare const shuffleString: (str?: string) => string;
679
+ declare const findGlobalWord: (text?: string, word?: string) => boolean;
680
+ declare const extractUrls: (text?: string) => string[];
681
+ declare const randomize: (arr: string[]) => string;
682
+ declare const pickKeysFromArray: (arr: any[], keys: string[]) => any;
683
+ declare const findNestedByKeys: (data: unknown, target: Record<string, any> | Record<string, any>[]) => any;
684
+ declare const modifyFn: <T extends (...args: any[]) => any>(fn: T, before?: (args: any[]) => void | any, after?: (result: any, args: any[]) => any) => T;
685
+
686
+ declare const generateId: (input: string | string[]) => string;
687
+ declare const getUsersMentions: (text?: string) => string[];
688
+ declare const extractJids: (text?: string) => string[];
689
+ declare const numbersToJids: (numbers: number[]) => string[];
690
+ declare const cleanMediaObject: (object: any) => _.Omit<any, "url" | "contextInfo" | "fileSha256" | "fileEncSha256" | "mediaKey" | "directPath" | "waveform" | "thumbnail" | "jpegThumbnail" | "thumbnailEncSha256" | "thumbnailSha256" | "thumbnailDirectPath" | "firstFrameSidecar" | "streamingSidecar" | "scansSidecar" | "callKey" | "message" | "key" | "midQualityFileSha256" | "historySyncNotification" | "appStateSyncKeyShare" | "appStateSyncKeyRequest" | "initialSecurityNotificationSettingSync" | "appStateFatalExceptionNotification" | "disappearingMode" | "peerDataOperationRequestMessage" | "peerDataOperationRequestResponseMessage" | "botFeedbackMessage">;
691
+ declare const getDeepContent: (raw?: proto.IMessage | null) => {
692
+ leaf: any;
693
+ chain: string[];
694
+ };
695
+ declare const cleanJid: (jid: string) => number;
696
+
697
+ type MediaInput = string | ArrayBuffer | Buffer;
698
+ type AudioType = 'opus' | 'mp3';
699
+ declare class AudioProcessor {
700
+ static getWaAudio(input: MediaInput, type?: AudioType): Promise<Buffer>;
701
+ }
702
+ declare class VideoProcessor {
703
+ static getThumbnail(input: MediaInput): Promise<string>;
704
+ static getDuration(filePath: string): Promise<number>;
705
+ }
706
+ declare class ImageProcessor {
707
+ static getThumbnail(buffer: Buffer): Promise<string>;
708
+ static resizeForSticker(buffer: Buffer, quality: number): Promise<Buffer>;
709
+ }
710
+ declare class MediaProcessor {
711
+ static getThumbnail(input: MediaInput): Promise<string>;
712
+ }
713
+ declare class StickerProcessor {
714
+ private static createExifMetadata;
715
+ private static processAnimated;
716
+ private static getExtension;
717
+ static create(input: MediaInput, metadata?: z.infer<typeof StickerMetadataType>): Promise<Buffer>;
718
+ }
719
+ declare class DocumentProcessor {
720
+ static create(input: MediaInput): Promise<{
721
+ document: any;
722
+ mimetype: string;
723
+ fileName: string;
724
+ jpegThumbnail: string;
857
725
  }>;
858
- reply(props: ExtractZod<typeof RelayReplyType>): Promise<{
859
- chatId: string;
860
- channelId: string;
861
- uniqueId: string;
862
- receiverId: string;
863
- receiverName: string;
864
- roomId: string;
865
- roomName: string;
866
- senderLid: string;
867
- senderId: string;
868
- senderName: string;
869
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
870
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
871
- timestamp: number;
872
- mentions: string[];
873
- links: string[];
874
- isPrefix: boolean;
875
- isSpam: boolean;
876
- isFromMe: boolean;
877
- isTagMe: boolean;
878
- isGroup: boolean;
879
- isStory: boolean;
880
- isViewOnce: boolean;
881
- isEdited: boolean;
882
- isDeleted: boolean;
883
- isPinned: boolean;
884
- isUnPinned: boolean;
885
- isChannel: boolean;
886
- isBroadcast: boolean;
887
- isEphemeral: boolean;
888
- isForwarded: boolean;
889
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
890
- text?: string;
891
- citation?: Record<string, boolean>;
892
- media?: {
893
- [x: string]: unknown;
894
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
895
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
896
- };
897
- replied?: {
898
- chatId: string;
899
- channelId: string;
900
- uniqueId: string;
901
- receiverId: string;
902
- receiverName: string;
903
- roomId: string;
904
- roomName: string;
905
- senderLid: string;
906
- senderId: string;
907
- senderName: string;
908
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
909
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
910
- timestamp: number;
911
- mentions: string[];
912
- links: string[];
913
- isPrefix: boolean;
914
- isSpam: boolean;
915
- isFromMe: boolean;
916
- isTagMe: boolean;
917
- isGroup: boolean;
918
- isStory: boolean;
919
- isViewOnce: boolean;
920
- isEdited: boolean;
921
- isDeleted: boolean;
922
- isPinned: boolean;
923
- isUnPinned: boolean;
924
- isChannel: boolean;
925
- isBroadcast: boolean;
926
- isEphemeral: boolean;
927
- isForwarded: boolean;
928
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
929
- text?: string;
930
- citation?: Record<string, boolean>;
931
- media?: {
932
- [x: string]: unknown;
933
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
934
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
935
- };
936
- replied?: /*elided*/ any;
937
- };
938
- }>;
939
- forward(props: ExtractZod<typeof RelayForwardType>): Promise<{
940
- chatId: string;
941
- channelId: string;
942
- uniqueId: string;
943
- receiverId: string;
944
- receiverName: string;
945
- roomId: string;
946
- roomName: string;
947
- senderLid: string;
948
- senderId: string;
949
- senderName: string;
950
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
951
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
952
- timestamp: number;
953
- mentions: string[];
954
- links: string[];
955
- isPrefix: boolean;
956
- isSpam: boolean;
957
- isFromMe: boolean;
958
- isTagMe: boolean;
959
- isGroup: boolean;
960
- isStory: boolean;
961
- isViewOnce: boolean;
962
- isEdited: boolean;
963
- isDeleted: boolean;
964
- isPinned: boolean;
965
- isUnPinned: boolean;
966
- isChannel: boolean;
967
- isBroadcast: boolean;
968
- isEphemeral: boolean;
969
- isForwarded: boolean;
970
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
971
- text?: string;
972
- citation?: Record<string, boolean>;
973
- media?: {
974
- [x: string]: unknown;
975
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
976
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
977
- };
978
- replied?: {
979
- chatId: string;
980
- channelId: string;
981
- uniqueId: string;
982
- receiverId: string;
983
- receiverName: string;
984
- roomId: string;
985
- roomName: string;
986
- senderLid: string;
987
- senderId: string;
988
- senderName: string;
989
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
990
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
991
- timestamp: number;
992
- mentions: string[];
993
- links: string[];
994
- isPrefix: boolean;
995
- isSpam: boolean;
996
- isFromMe: boolean;
997
- isTagMe: boolean;
998
- isGroup: boolean;
999
- isStory: boolean;
1000
- isViewOnce: boolean;
1001
- isEdited: boolean;
1002
- isDeleted: boolean;
1003
- isPinned: boolean;
1004
- isUnPinned: boolean;
1005
- isChannel: boolean;
1006
- isBroadcast: boolean;
1007
- isEphemeral: boolean;
1008
- isForwarded: boolean;
1009
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1010
- text?: string;
1011
- citation?: Record<string, boolean>;
1012
- media?: {
1013
- [x: string]: unknown;
1014
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1015
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1016
- };
1017
- replied?: /*elided*/ any;
1018
- };
1019
- }>;
1020
- edit(props: ExtractZod<typeof RelayEditType>): Promise<{
1021
- chatId: string;
1022
- channelId: string;
1023
- uniqueId: string;
1024
- receiverId: string;
1025
- receiverName: string;
1026
- roomId: string;
1027
- roomName: string;
1028
- senderLid: string;
1029
- senderId: string;
1030
- senderName: string;
1031
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1032
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1033
- timestamp: number;
1034
- mentions: string[];
1035
- links: string[];
1036
- isPrefix: boolean;
1037
- isSpam: boolean;
1038
- isFromMe: boolean;
1039
- isTagMe: boolean;
1040
- isGroup: boolean;
1041
- isStory: boolean;
1042
- isViewOnce: boolean;
1043
- isEdited: boolean;
1044
- isDeleted: boolean;
1045
- isPinned: boolean;
1046
- isUnPinned: boolean;
1047
- isChannel: boolean;
1048
- isBroadcast: boolean;
1049
- isEphemeral: boolean;
1050
- isForwarded: boolean;
1051
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1052
- text?: string;
1053
- citation?: Record<string, boolean>;
1054
- media?: {
1055
- [x: string]: unknown;
1056
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1057
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1058
- };
1059
- replied?: {
1060
- chatId: string;
1061
- channelId: string;
1062
- uniqueId: string;
1063
- receiverId: string;
1064
- receiverName: string;
1065
- roomId: string;
1066
- roomName: string;
1067
- senderLid: string;
1068
- senderId: string;
1069
- senderName: string;
1070
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1071
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1072
- timestamp: number;
1073
- mentions: string[];
1074
- links: string[];
1075
- isPrefix: boolean;
1076
- isSpam: boolean;
1077
- isFromMe: boolean;
1078
- isTagMe: boolean;
1079
- isGroup: boolean;
1080
- isStory: boolean;
1081
- isViewOnce: boolean;
1082
- isEdited: boolean;
1083
- isDeleted: boolean;
1084
- isPinned: boolean;
1085
- isUnPinned: boolean;
1086
- isChannel: boolean;
1087
- isBroadcast: boolean;
1088
- isEphemeral: boolean;
1089
- isForwarded: boolean;
1090
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1091
- text?: string;
1092
- citation?: Record<string, boolean>;
1093
- media?: {
1094
- [x: string]: unknown;
1095
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1096
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1097
- };
1098
- replied?: /*elided*/ any;
1099
- };
1100
- }>;
1101
- delete(props: ExtractZod<typeof RelayDeleteType>): Promise<{
1102
- chatId: string;
1103
- channelId: string;
1104
- uniqueId: string;
1105
- receiverId: string;
1106
- receiverName: string;
1107
- roomId: string;
1108
- roomName: string;
1109
- senderLid: string;
1110
- senderId: string;
1111
- senderName: string;
1112
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1113
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1114
- timestamp: number;
1115
- mentions: string[];
1116
- links: string[];
1117
- isPrefix: boolean;
1118
- isSpam: boolean;
1119
- isFromMe: boolean;
1120
- isTagMe: boolean;
1121
- isGroup: boolean;
1122
- isStory: boolean;
1123
- isViewOnce: boolean;
1124
- isEdited: boolean;
1125
- isDeleted: boolean;
1126
- isPinned: boolean;
1127
- isUnPinned: boolean;
1128
- isChannel: boolean;
1129
- isBroadcast: boolean;
1130
- isEphemeral: boolean;
1131
- isForwarded: boolean;
1132
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1133
- text?: string;
1134
- citation?: Record<string, boolean>;
1135
- media?: {
1136
- [x: string]: unknown;
1137
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1138
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1139
- };
1140
- replied?: {
1141
- chatId: string;
1142
- channelId: string;
1143
- uniqueId: string;
1144
- receiverId: string;
1145
- receiverName: string;
1146
- roomId: string;
1147
- roomName: string;
1148
- senderLid: string;
1149
- senderId: string;
1150
- senderName: string;
1151
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1152
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1153
- timestamp: number;
1154
- mentions: string[];
1155
- links: string[];
1156
- isPrefix: boolean;
1157
- isSpam: boolean;
1158
- isFromMe: boolean;
1159
- isTagMe: boolean;
1160
- isGroup: boolean;
1161
- isStory: boolean;
1162
- isViewOnce: boolean;
1163
- isEdited: boolean;
1164
- isDeleted: boolean;
1165
- isPinned: boolean;
1166
- isUnPinned: boolean;
1167
- isChannel: boolean;
1168
- isBroadcast: boolean;
1169
- isEphemeral: boolean;
1170
- isForwarded: boolean;
1171
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1172
- text?: string;
1173
- citation?: Record<string, boolean>;
1174
- media?: {
1175
- [x: string]: unknown;
1176
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1177
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1178
- };
1179
- replied?: /*elided*/ any;
1180
- };
1181
- }>;
1182
- reject(props: ExtractZod<typeof RelayRejectType>): Promise<void>;
1183
- presence(props: ExtractZod<typeof RelayPresenceType>): Promise<void>;
1184
- reaction(props: ExtractZod<typeof RelayReactionType>): Promise<{
1185
- chatId: string;
1186
- channelId: string;
1187
- uniqueId: string;
1188
- receiverId: string;
1189
- receiverName: string;
1190
- roomId: string;
1191
- roomName: string;
1192
- senderLid: string;
1193
- senderId: string;
1194
- senderName: string;
1195
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1196
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1197
- timestamp: number;
1198
- mentions: string[];
1199
- links: string[];
1200
- isPrefix: boolean;
1201
- isSpam: boolean;
1202
- isFromMe: boolean;
1203
- isTagMe: boolean;
1204
- isGroup: boolean;
1205
- isStory: boolean;
1206
- isViewOnce: boolean;
1207
- isEdited: boolean;
1208
- isDeleted: boolean;
1209
- isPinned: boolean;
1210
- isUnPinned: boolean;
1211
- isChannel: boolean;
1212
- isBroadcast: boolean;
1213
- isEphemeral: boolean;
1214
- isForwarded: boolean;
1215
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1216
- text?: string;
1217
- citation?: Record<string, boolean>;
1218
- media?: {
1219
- [x: string]: unknown;
1220
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1221
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1222
- };
1223
- replied?: {
1224
- chatId: string;
1225
- channelId: string;
1226
- uniqueId: string;
1227
- receiverId: string;
1228
- receiverName: string;
1229
- roomId: string;
1230
- roomName: string;
1231
- senderLid: string;
1232
- senderId: string;
1233
- senderName: string;
1234
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1235
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1236
- timestamp: number;
1237
- mentions: string[];
1238
- links: string[];
1239
- isPrefix: boolean;
1240
- isSpam: boolean;
1241
- isFromMe: boolean;
1242
- isTagMe: boolean;
1243
- isGroup: boolean;
1244
- isStory: boolean;
1245
- isViewOnce: boolean;
1246
- isEdited: boolean;
1247
- isDeleted: boolean;
1248
- isPinned: boolean;
1249
- isUnPinned: boolean;
1250
- isChannel: boolean;
1251
- isBroadcast: boolean;
1252
- isEphemeral: boolean;
1253
- isForwarded: boolean;
1254
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1255
- text?: string;
1256
- citation?: Record<string, boolean>;
1257
- media?: {
1258
- [x: string]: unknown;
1259
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1260
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1261
- };
1262
- replied?: /*elided*/ any;
1263
- };
1264
- }>;
1265
- document(type: ExtractZod<typeof RelayDocumentEnumType>, props: ExtractZod<typeof RelayDocumentType>): Promise<void>;
1266
- image(type: ExtractZod<typeof RelayImageEnumType>, props: ExtractZod<typeof RelayImageType>): Promise<{
1267
- chatId: string;
1268
- channelId: string;
1269
- uniqueId: string;
1270
- receiverId: string;
1271
- receiverName: string;
1272
- roomId: string;
1273
- roomName: string;
1274
- senderLid: string;
1275
- senderId: string;
1276
- senderName: string;
1277
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1278
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1279
- timestamp: number;
1280
- mentions: string[];
1281
- links: string[];
1282
- isPrefix: boolean;
1283
- isSpam: boolean;
1284
- isFromMe: boolean;
1285
- isTagMe: boolean;
1286
- isGroup: boolean;
1287
- isStory: boolean;
1288
- isViewOnce: boolean;
1289
- isEdited: boolean;
1290
- isDeleted: boolean;
1291
- isPinned: boolean;
1292
- isUnPinned: boolean;
1293
- isChannel: boolean;
1294
- isBroadcast: boolean;
1295
- isEphemeral: boolean;
1296
- isForwarded: boolean;
1297
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1298
- text?: string;
1299
- citation?: Record<string, boolean>;
1300
- media?: {
1301
- [x: string]: unknown;
1302
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1303
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1304
- };
1305
- replied?: {
1306
- chatId: string;
1307
- channelId: string;
1308
- uniqueId: string;
1309
- receiverId: string;
1310
- receiverName: string;
1311
- roomId: string;
1312
- roomName: string;
1313
- senderLid: string;
1314
- senderId: string;
1315
- senderName: string;
1316
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1317
- chatType: "contacts" | "event" | "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "highlyStructured" | "sendPayment" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "buttons" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "ephemeral" | "invoice" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "comment" | "placeholder" | "encEventUpdate";
1318
- timestamp: number;
1319
- mentions: string[];
1320
- links: string[];
1321
- isPrefix: boolean;
1322
- isSpam: boolean;
1323
- isFromMe: boolean;
1324
- isTagMe: boolean;
1325
- isGroup: boolean;
1326
- isStory: boolean;
1327
- isViewOnce: boolean;
1328
- isEdited: boolean;
1329
- isDeleted: boolean;
1330
- isPinned: boolean;
1331
- isUnPinned: boolean;
1332
- isChannel: boolean;
1333
- isBroadcast: boolean;
1334
- isEphemeral: boolean;
1335
- isForwarded: boolean;
1336
- message: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
1337
- text?: string;
1338
- citation?: Record<string, boolean>;
1339
- media?: {
1340
- [x: string]: unknown;
1341
- buffer: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1342
- stream: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
1343
- };
1344
- replied?: /*elided*/ any;
1345
- };
1346
- }>;
1347
- sticker(type: ExtractZod<typeof RelayStickerEnumType>, props: ExtractZod<typeof RelayStickerType>): Promise<void>;
1348
- video(type: ExtractZod<typeof RelayVideoEnumType>, props: ExtractZod<typeof RelayVideoType>): Promise<void>;
1349
- audio(type: ExtractZod<typeof RelayAudioEnumType>, props: ExtractZod<typeof RelayAudioType>): Promise<void>;
1350
- voice(type: ExtractZod<typeof RelayAudioEnumType>, props: ExtractZod<typeof RelayAudioType>): Promise<void>;
1351
- note(type: ExtractZod<typeof RelayVideoEnumType>, props: ExtractZod<typeof RelayVideoType>): Promise<void>;
1352
- gif(type: ExtractZod<typeof RelayVideoEnumType>, props: ExtractZod<typeof RelayVideoType>): Promise<void>;
1353
- location(type: ExtractZod<typeof RelayLocationEnumType>, props: ExtractZod<typeof RelayLocationType>): Promise<void>;
1354
- contacts(type: ExtractZod<typeof RelayContactEnumType>, props: ExtractZod<typeof RelayContactType>): Promise<void>;
1355
- poll(type: ExtractZod<typeof RelayPollEnumType>, props: ExtractZod<typeof RelayPollType>): Promise<void>;
1356
- button(type: ExtractZod<typeof RelayButtonEnumType>, props: ExtractZod<typeof RelayButtonType>): Promise<void>;
1357
- group(): {
1358
- create: (props: ExtractZod<typeof RelayGroupCreateType>) => Promise<baileys.GroupMetadata>;
1359
- action: (props: ExtractZod<typeof RelayGroupActionType>) => Promise<{
1360
- status: string;
1361
- jid: string;
1362
- content: baileys.BinaryNode;
1363
- }[]>;
1364
- update: (props: ExtractZod<typeof RelayGroupUpdateType>) => Promise<void>;
1365
- settings: (props: ExtractZod<typeof RelayGroupSettingsType>) => Promise<void>;
1366
- leave: (props: ExtractZod<typeof RelayGroupLeaveType>) => Promise<void>;
1367
- links: (props: ExtractZod<typeof RelayGroupLinksType>) => Promise<string>;
1368
- invite: (props: ExtractZod<typeof RelayGroupInviteType>) => Promise<string | baileys.GroupMetadata>;
1369
- metadata: (props: ExtractZod<typeof RelayGroupMetadataType>) => Promise<baileys.GroupMetadata>;
1370
- requests: {
1371
- list: (props: ExtractZod<typeof RelayGroupRequestsListType>) => Promise<{
1372
- [key: string]: string;
1373
- }[]>;
1374
- approve: (props: ExtractZod<typeof RelayGroupRequestsApproveType>) => Promise<{
1375
- status: string;
1376
- jid: string;
1377
- }[]>;
1378
- reject: (props: ExtractZod<typeof RelayGroupRequestsRejectType>) => Promise<{
1379
- status: string;
1380
- jid: string;
1381
- }[]>;
1382
- };
1383
- };
1384
- privacy(): {
1385
- update: (props: ExtractZod<typeof RelayPrivacyUpdateType>) => Promise<void>;
1386
- fetch: {
1387
- settings: () => Promise<{
1388
- [_: string]: string;
1389
- }>;
1390
- blocklists: () => Promise<string[]>;
1391
- };
1392
- };
1393
- profile(): {
1394
- bio: (props: ExtractZod<typeof RelayProfileBioType>) => Promise<baileys.USyncQueryResultList[]>;
1395
- avatar: (props: ExtractZod<typeof RelayProfileBioType>) => Promise<string>;
1396
- business: (props: ExtractZod<typeof RelayProfileBioType>) => Promise<void | baileys.WABusinessProfile>;
1397
- update: (props: ExtractZod<typeof RelayProfileUpdateType>) => Promise<void>;
1398
- check: (props: ExtractZod<typeof RelayProfileCheckType>) => Promise<{
1399
- jid: string;
1400
- exists: unknown;
1401
- lid: unknown;
1402
- isOnWhatsApp: boolean;
1403
- avatar: string;
1404
- bio: baileys.USyncQueryResultList[];
1405
- } | {
1406
- isOnWhatsApp: boolean;
1407
- }>;
1408
- };
1409
726
  }
1410
-
1411
- declare class Client {
1412
- props: ExtractZod<typeof ClientOptionsType>;
1413
- db: JsonDBInterface;
1414
- private logger;
1415
- private events;
1416
- private relay;
1417
- private retryCount;
1418
- private maxRetries;
1419
- private connectionTimeout;
1420
- spinner: nanospinner.Spinner;
1421
- socket: ReturnType<typeof baileys__default> | undefined;
1422
- cache: NodeCache;
1423
- constructor(props: ExtractZod<typeof ClientOptionsType>);
1424
- initialize(): Promise<void>;
1425
- private startConnectionTimeout;
1426
- private handleConnectionTimeout;
1427
- private autoReload;
1428
- resetRetryCount(): void;
1429
- on<T extends ExtractZod<typeof EventEnumType>>(event: T, handler: EventCallbackType[T]): void;
1430
- emit<T extends ExtractZod<typeof EventEnumType>>(event: T, ...args: Parameters<EventCallbackType[T]>): void;
1431
- }
1432
- interface Client extends Relay {
1433
- }
1434
-
1435
- declare const toJson: (object: unknown) => any;
1436
- declare const toString: (object: unknown) => string;
1437
- declare const shuffleString: (str: string) => string;
1438
- declare const tryAgain: <T>(fn: () => Promise<T>) => Promise<T>;
1439
- declare const findWord: (text?: string, word?: string) => boolean;
1440
- declare const normalizeText: (text?: string) => string;
1441
- declare const extractJids: (text?: string) => string[];
1442
- declare const extractUrls: (text?: string) => string[];
1443
- declare const getMentions: (text?: string) => string[];
1444
- declare const randomize: (arr: string[]) => string;
1445
- declare const delay: (ms: number) => Promise<unknown>;
1446
-
1447
- export { AdsReplyType, CitationType, Client, ClientAuthPairingType, ClientAuthQRType, ClientBaseType, ClientOptionsType, type EventCallbackType, EventEnumType, type ExtractZod, ExtractorCallsType, ExtractorConnectionType, ExtractorMessagesType, FakeReplyType, JsonDB, type JsonDBInterface, LimiterType, MessagesDeviceEnumType, MessagesEnumType, MessagesMediaType, MessagesVerifiedPlatformType, PluginsType, defaultBoolean, defaultString, delay, extractJids, extractUrls, findWord, getMentions, normalizeText, randomize, shuffleString, toJson, toString, tryAgain };
727
+ declare const toBuffer: any;
728
+ declare const getWaAudio: any;
729
+ declare const getVideoThumbnail: any;
730
+ declare const getVideoDuration: any;
731
+ declare const getMediaThumbnail: any;
732
+ declare const getWaSticker: any;
733
+ declare const getWaDocument: any;
734
+
735
+ export { AudioProcessor, type AudioType, Client, DocumentProcessor, ImageProcessor, Lowdb, MediaProcessor, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, StickerProcessor, VideoProcessor, cleanJid, cleanMediaObject, createLowdb, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getLatestLibVersion, getMediaThumbnail, getUsersMentions, getVideoDuration, getVideoThumbnail, getWaAudio, getWaDocument, getWaSticker, ignoreLint, logColor, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, shuffleString, toBuffer, toJson, toString, useAuthState };