@ostyado/baileys 1.1.0 → 1.1.1

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.
Files changed (49) hide show
  1. package/README.md +380 -2
  2. package/WAProto/index.js +56886 -17506
  3. package/engine-requirements.js +10 -0
  4. package/lib/Defaults/baileys-version.json +1 -1
  5. package/lib/Defaults/index.js +19 -2
  6. package/lib/Socket/chats.d.ts +215 -32
  7. package/lib/Socket/chats.js +168 -75
  8. package/lib/Socket/dugong.d.ts +254 -0
  9. package/lib/Socket/dugong.js +484 -0
  10. package/lib/Socket/groups.js +18 -18
  11. package/lib/Socket/index.js +1 -0
  12. package/lib/Socket/messages-send.d.ts +2 -2
  13. package/lib/Socket/messages-send.js +323 -348
  14. package/lib/Socket/newsletter.js +136 -21
  15. package/lib/Socket/socket.js +66 -31
  16. package/lib/Types/Newsletter.d.ts +97 -86
  17. package/lib/Types/Newsletter.js +38 -32
  18. package/lib/Utils/generics.js +65 -33
  19. package/lib/Utils/messages-media.js +145 -57
  20. package/lib/Utils/messages.js +24 -44
  21. package/lib/Utils/signal.js +48 -46
  22. package/lib/Utils/use-multi-file-auth-state.js +45 -6
  23. package/lib/Utils/validate-connection.js +89 -65
  24. package/lib/WABinary/constants.d.ts +27 -24
  25. package/lib/WABinary/encode.js +160 -123
  26. package/lib/WABinary/generic-utils.d.ts +2 -1
  27. package/lib/WABinary/generic-utils.js +123 -43
  28. package/lib/index.d.ts +1 -0
  29. package/lib/index.js +12 -2
  30. package/package.json +104 -100
  31. package/WAProto/GenerateStatics.sh +0 -4
  32. package/WAProto/WAProto.proto +0 -3344
  33. package/WAProto/index.d.ts +0 -37016
  34. package/WASignalGroup/GroupProtocol.js +0 -1697
  35. package/WASignalGroup/ciphertext_message.js +0 -16
  36. package/WASignalGroup/group_cipher.js +0 -120
  37. package/WASignalGroup/group_session_builder.js +0 -46
  38. package/WASignalGroup/index.js +0 -5
  39. package/WASignalGroup/keyhelper.js +0 -21
  40. package/WASignalGroup/protobufs.js +0 -3
  41. package/WASignalGroup/queue_job.js +0 -69
  42. package/WASignalGroup/sender_chain_key.js +0 -50
  43. package/WASignalGroup/sender_key_distribution_message.js +0 -78
  44. package/WASignalGroup/sender_key_message.js +0 -92
  45. package/WASignalGroup/sender_key_name.js +0 -70
  46. package/WASignalGroup/sender_key_record.js +0 -56
  47. package/WASignalGroup/sender_key_state.js +0 -129
  48. package/WASignalGroup/sender_message_key.js +0 -39
  49. package/lib/Signal/Group/x +0 -1
@@ -0,0 +1,484 @@
1
+ // "kikyy dugonggg", ah dejavu (r)
2
+ // tanggal 14 agustus 2025 makassar
3
+ // telegram: @tskiofc & @kyuucode
4
+
5
+ const WAProto = require('../../WAProto').proto;
6
+ const crypto = require('crypto');
7
+ const Utils_1 = require("../Utils");
8
+
9
+ class kikyy {
10
+ constructor(utils, waUploadToServer, relayMessageFn) {
11
+ this.utils = utils;
12
+ this.relayMessage = relayMessageFn
13
+ this.waUploadToServer = waUploadToServer;
14
+
15
+ this.bail = {
16
+ generateWAMessageContent: this.utils.generateWAMessageContent || Utils_1.generateWAMessageContent,
17
+ generateMessageID: Utils_1.generateMessageID,
18
+ getContentType: (msg) => Object.keys(msg.message || {})[0]
19
+ };
20
+ }
21
+
22
+ detectType(content) {
23
+ if (content.requestPaymentMessage) return 'PAYMENT';
24
+ if (content.productMessage) return 'PRODUCT';
25
+ if (content.interactiveMessage) return 'INTERACTIVE';
26
+ if (content.albumMessage) return 'ALBUM';
27
+ if (content.eventMessage) return 'EVENT';
28
+ if (content.pollResultMessage) return 'POLL_RESULT';
29
+ if (content.groupStatusMessage) return 'GROUP_STORY';
30
+ return null;
31
+ }
32
+
33
+ async handlePayment(content, quoted) {
34
+ const data = content.requestPaymentMessage;
35
+ let notes = {};
36
+
37
+ if (data.sticker?.stickerMessage) {
38
+ notes = {
39
+ stickerMessage: {
40
+ ...data.sticker.stickerMessage,
41
+ contextInfo: {
42
+ stanzaId: quoted?.key?.id,
43
+ participant: quoted?.key?.participant || content.sender,
44
+ quotedMessage: quoted?.message
45
+ }
46
+ }
47
+ };
48
+ } else if (data.note) {
49
+ notes = {
50
+ extendedTextMessage: {
51
+ text: data.note,
52
+ contextInfo: {
53
+ stanzaId: quoted?.key?.id,
54
+ participant: quoted?.key?.participant || content.sender,
55
+ quotedMessage: quoted?.message
56
+ }
57
+ }
58
+ };
59
+ }
60
+
61
+ return {
62
+ requestPaymentMessage: WAProto.Message.RequestPaymentMessage.fromObject({
63
+ expiryTimestamp: data.expiry || 0,
64
+ amount1000: data.amount || 0,
65
+ currencyCodeIso4217: data.currency || "IDR",
66
+ requestFrom: data.from || "0@s.whatsapp.net",
67
+ noteMessage: notes,
68
+ background: data.background ?? {
69
+ id: "DEFAULT",
70
+ placeholderArgb: 0xFFF0F0F0
71
+ }
72
+ })
73
+ };
74
+ }
75
+
76
+ async handleProduct(content, jid, quoted) {
77
+ const {
78
+ title,
79
+ description,
80
+ thumbnail,
81
+ productId,
82
+ retailerId,
83
+ url,
84
+ body = "",
85
+ footer = "",
86
+ buttons = [],
87
+ priceAmount1000 = null,
88
+ currencyCode = "IDR"
89
+ } = content.productMessage;
90
+
91
+ let productImage;
92
+
93
+ if (Buffer.isBuffer(thumbnail)) {
94
+ const { imageMessage } = await this.utils.generateWAMessageContent(
95
+ { image: thumbnail },
96
+ { upload: this.waUploadToServer }
97
+ );
98
+ productImage = imageMessage;
99
+ } else if (typeof thumbnail === 'object' && thumbnail.url) {
100
+ const { imageMessage } = await this.utils.generateWAMessageContent(
101
+ { image: { url: thumbnail.url }},
102
+ { upload: this.waUploadToServer }
103
+ );
104
+ productImage = imageMessage;
105
+ }
106
+
107
+ return {
108
+ viewOnceMessage: {
109
+ message: {
110
+ interactiveMessage: {
111
+ body: { text: body },
112
+ footer: { text: footer },
113
+ header: {
114
+ title,
115
+ hasMediaAttachment: true,
116
+ productMessage: {
117
+ product: {
118
+ productImage,
119
+ productId,
120
+ title,
121
+ description,
122
+ currencyCode,
123
+ priceAmount1000,
124
+ retailerId,
125
+ url,
126
+ productImageCount: 1
127
+ },
128
+ businessOwnerJid: "0@s.whatsapp.net"
129
+ }
130
+ },
131
+ nativeFlowMessage: { buttons }
132
+ }
133
+ }
134
+ }
135
+ };
136
+ }
137
+
138
+ async handleInteractive(content, jid, quoted) {
139
+ const {
140
+ title,
141
+ footer,
142
+ thumbnail,
143
+ image,
144
+ video,
145
+ document,
146
+ mimetype,
147
+ fileName,
148
+ jpegThumbnail,
149
+ contextInfo,
150
+ externalAdReply,
151
+ buttons = [],
152
+ nativeFlowMessage,
153
+ header
154
+ } = content.interactiveMessage;
155
+
156
+ let media = null;
157
+ let mediaType = null;
158
+
159
+ if (thumbnail) {
160
+ media = await this.utils.prepareWAMessageMedia(
161
+ { image: { url: thumbnail } },
162
+ { upload: this.waUploadToServer }
163
+ );
164
+ mediaType = 'image';
165
+ } else if (image) {
166
+ if (typeof image === 'object' && image.url) {
167
+ media = await this.utils.prepareWAMessageMedia(
168
+ { image: { url: image.url } },
169
+ { upload: this.waUploadToServer }
170
+ );
171
+ } else {
172
+ media = await this.utils.prepareWAMessageMedia(
173
+ { image: image },
174
+ { upload: this.waUploadToServer }
175
+ );
176
+ }
177
+ mediaType = 'image';
178
+ } else if (video) {
179
+ if (typeof video === 'object' && video.url) {
180
+ media = await this.utils.prepareWAMessageMedia(
181
+ { video: { url: video.url } },
182
+ { upload: this.waUploadToServer }
183
+ );
184
+ } else {
185
+ media = await this.utils.prepareWAMessageMedia(
186
+ { video: video },
187
+ { upload: this.waUploadToServer }
188
+ );
189
+ }
190
+ mediaType = 'video';
191
+ } else if (document) {
192
+ let documentPayload = {
193
+ document: document
194
+ };
195
+ if (jpegThumbnail) {
196
+ if (typeof jpegThumbnail === 'object' && jpegThumbnail.url) {
197
+ documentPayload.jpegThumbnail = { url: jpegThumbnail.url };
198
+ } else {
199
+ documentPayload.jpegThumbnail = jpegThumbnail;
200
+ }
201
+ }
202
+
203
+ media = await this.utils.prepareWAMessageMedia(
204
+ documentPayload,
205
+ { upload: this.waUploadToServer }
206
+ );
207
+ if (fileName) {
208
+ media.documentMessage.fileName = fileName;
209
+ }
210
+ if (mimetype) {
211
+ media.documentMessage.mimetype = mimetype;
212
+ }
213
+ mediaType = 'document';
214
+ }
215
+ let interactiveMessage = {
216
+ body: { text: title || "" },
217
+ footer: { text: footer || "" }
218
+ };
219
+ if (buttons && buttons.length > 0) {
220
+ interactiveMessage.nativeFlowMessage = {
221
+ buttons: buttons
222
+ };
223
+ if (nativeFlowMessage) {
224
+ interactiveMessage.nativeFlowMessage = {
225
+ ...interactiveMessage.nativeFlowMessage,
226
+ ...nativeFlowMessage
227
+ };
228
+ }
229
+ } else if (nativeFlowMessage) {
230
+ interactiveMessage.nativeFlowMessage = nativeFlowMessage;
231
+ }
232
+
233
+ if (media) {
234
+ interactiveMessage.header = {
235
+ title: header || "",
236
+ hasMediaAttachment: true,
237
+ ...media
238
+ };
239
+ } else {
240
+ interactiveMessage.header = {
241
+ title: header || "",
242
+ hasMediaAttachment: false
243
+ };
244
+ }
245
+
246
+ let finalContextInfo = {};
247
+ if (contextInfo) {
248
+ finalContextInfo = {
249
+ mentionedJid: contextInfo.mentionedJid || [],
250
+ forwardingScore: contextInfo.forwardingScore || 0,
251
+ isForwarded: contextInfo.isForwarded || false,
252
+ ...contextInfo
253
+ };
254
+ }
255
+
256
+ if (externalAdReply) {
257
+ finalContextInfo.externalAdReply = {
258
+ title: externalAdReply.title || "",
259
+ body: externalAdReply.body || "",
260
+ mediaType: externalAdReply.mediaType || 1,
261
+ thumbnailUrl: externalAdReply.thumbnailUrl || "",
262
+ mediaUrl: externalAdReply.mediaUrl || "",
263
+ sourceUrl: externalAdReply.sourceUrl || "",
264
+ showAdAttribution: externalAdReply.showAdAttribution || false,
265
+ renderLargerThumbnail: externalAdReply.renderLargerThumbnail || false,
266
+ ...externalAdReply
267
+ };
268
+ }
269
+
270
+ if (Object.keys(finalContextInfo).length > 0) {
271
+ interactiveMessage.contextInfo = finalContextInfo;
272
+ }
273
+ return {
274
+ interactiveMessage: interactiveMessage
275
+ };
276
+ }
277
+
278
+ async handleAlbum(content, jid, quoted) {
279
+ const array = content.albumMessage;
280
+ const album = await this.utils.generateWAMessageFromContent(jid, {
281
+ messageContextInfo: {
282
+ messageSecret: crypto.randomBytes(32),
283
+ },
284
+ albumMessage: {
285
+ expectedImageCount: array.filter((a) => a.hasOwnProperty("image")).length,
286
+ expectedVideoCount: array.filter((a) => a.hasOwnProperty("video")).length,
287
+ },
288
+ }, {
289
+ userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
290
+ quoted,
291
+ upload: this.waUploadToServer
292
+ });
293
+
294
+ await this.relayMessage(jid, album.message, {
295
+ messageId: album.key.id,
296
+ });
297
+
298
+ for (let content of array) {
299
+ const img = await this.utils.generateWAMessage(jid, content, {
300
+ upload: this.waUploadToServer,
301
+ });
302
+
303
+ img.message.messageContextInfo = {
304
+ messageSecret: crypto.randomBytes(32),
305
+ messageAssociation: {
306
+ associationType: 1,
307
+ parentMessageKey: album.key,
308
+ },
309
+ participant: "0@s.whatsapp.net",
310
+ remoteJid: "status@broadcast",
311
+ forwardingScore: 99999,
312
+ isForwarded: true,
313
+ mentionedJid: [jid],
314
+ starred: true,
315
+ labels: ["Y", "Important"],
316
+ isHighlighted: true,
317
+ businessMessageForwardInfo: {
318
+ businessOwnerJid: jid,
319
+ },
320
+ dataSharingContext: {
321
+ showMmDisclosure: true,
322
+ },
323
+ };
324
+
325
+ img.message.forwardedNewsletterMessageInfo = {
326
+ newsletterJid: "0@newsletter",
327
+ serverMessageId: 1,
328
+ newsletterName: `WhatsApp`,
329
+ contentType: 1,
330
+ timestamp: new Date().toISOString(),
331
+ senderName: "kikyy dugonggg",
332
+ content: "Text Message",
333
+ priority: "high",
334
+ status: "sent",
335
+ };
336
+
337
+ img.message.disappearingMode = {
338
+ initiator: 3,
339
+ trigger: 4,
340
+ initiatorDeviceJid: jid,
341
+ initiatedByExternalService: true,
342
+ initiatedByUserDevice: true,
343
+ initiatedBySystem: true,
344
+ initiatedByServer: true,
345
+ initiatedByAdmin: true,
346
+ initiatedByUser: true,
347
+ initiatedByApp: true,
348
+ initiatedByBot: true,
349
+ initiatedByMe: true,
350
+ };
351
+
352
+ await this.relayMessage(jid, img.message, {
353
+ messageId: img.key.id,
354
+ quoted: {
355
+ key: {
356
+ remoteJid: album.key.remoteJid,
357
+ id: album.key.id,
358
+ fromMe: true,
359
+ participant: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
360
+ },
361
+ message: album.message,
362
+ },
363
+ });
364
+ }
365
+ return album;
366
+ }
367
+
368
+ async handleEvent(content, jid, quoted) {
369
+ const eventData = content.eventMessage;
370
+
371
+ const msg = await this.utils.generateWAMessageFromContent(jid, {
372
+ viewOnceMessage: {
373
+ message: {
374
+ messageContextInfo: {
375
+ deviceListMetadata: {},
376
+ deviceListMetadataVersion: 2,
377
+ messageSecret: crypto.randomBytes(32),
378
+ supportPayload: JSON.stringify({
379
+ version: 2,
380
+ is_ai_message: true,
381
+ should_show_system_message: true,
382
+ ticket_id: crypto.randomBytes(16).toString('hex')
383
+ })
384
+ },
385
+ eventMessage: {
386
+ contextInfo: {
387
+ mentionedJid: [jid],
388
+ participant: jid,
389
+ remoteJid: "status@broadcast",
390
+ forwardedNewsletterMessageInfo: {
391
+ newsletterName: "shenvn.",
392
+ newsletterJid: "120363297591152843@newsletter",
393
+ serverMessageId: 1
394
+ }
395
+ },
396
+ isCanceled: eventData.isCanceled || false,
397
+ name: eventData.name,
398
+ description: eventData.description,
399
+ location: eventData.location || {
400
+ degreesLatitude: 0,
401
+ degreesLongitude: 0,
402
+ name: "Location"
403
+ },
404
+ joinLink: eventData.joinLink || '',
405
+ startTime: typeof eventData.startTime === 'string' ? parseInt(eventData.startTime) : eventData.startTime || Date.now(),
406
+ endTime: typeof eventData.endTime === 'string' ? parseInt(eventData.endTime) : eventData.endTime || Date.now() + 3600000,
407
+ extraGuestsAllowed: eventData.extraGuestsAllowed !== false
408
+ }
409
+ }
410
+ }
411
+ }, { quoted });
412
+
413
+ await this.relayMessage(jid, msg.message, {
414
+ messageId: msg.key.id
415
+ });
416
+ return msg;
417
+ }
418
+
419
+ async handlePollResult(content, jid, quoted) {
420
+ const pollData = content.pollResultMessage;
421
+
422
+ const msg = await this.utils.generateWAMessageFromContent(jid, {
423
+ pollResultSnapshotMessage: {
424
+ name: pollData.name,
425
+ pollVotes: pollData.pollVotes.map(vote => ({
426
+ optionName: vote.optionName,
427
+ optionVoteCount: typeof vote.optionVoteCount === 'number'
428
+ ? vote.optionVoteCount.toString()
429
+ : vote.optionVoteCount
430
+ }))
431
+ }
432
+ }, {
433
+ userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
434
+ quoted
435
+ });
436
+
437
+ await this.relayMessage(jid, msg.message, {
438
+ messageId: msg.key.id
439
+ });
440
+
441
+ return msg;
442
+ }
443
+
444
+ async handleGroupStory(content, jid, quoted) {
445
+ const storyData = content.groupStatusMessage;
446
+ let waMsgContent;
447
+
448
+ if (storyData.message) {
449
+ waMsgContent = storyData;
450
+ } else {
451
+ if (typeof this.bail?.generateWAMessageContent === "function") {
452
+ waMsgContent = await this.bail.generateWAMessageContent(storyData, {
453
+ upload: this.waUploadToServer
454
+ });
455
+ } else if (typeof this.utils?.generateWAMessageContent === "function") {
456
+ waMsgContent = await this.utils.generateWAMessageContent(storyData, {
457
+ upload: this.waUploadToServer
458
+ });
459
+ } else if (typeof this.utils?.prepareMessageContent === "function") {
460
+ waMsgContent = await this.utils.prepareMessageContent(storyData, {
461
+ upload: this.waUploadToServer
462
+ });
463
+ } else {
464
+ waMsgContent = await Utils_1.generateWAMessageContent(storyData, {
465
+ upload: this.waUploadToServer
466
+ });
467
+ }
468
+ }
469
+
470
+ let msg = {
471
+ message: {
472
+ groupStatusMessageV2: {
473
+ message: waMsgContent.message || waMsgContent
474
+ }
475
+ }
476
+ };
477
+
478
+ return await this.relayMessage(jid, msg.message, {
479
+ messageId: this.bail.generateMessageID()
480
+ });
481
+ }
482
+ }
483
+
484
+ module.exports = kikyy;
@@ -263,46 +263,46 @@ const makeGroupsSocket = (config) => {
263
263
  exports.makeGroupsSocket = makeGroupsSocket;
264
264
  const extractGroupMetadata = (result) => {
265
265
  var _a, _b;
266
- const group = (0, WABinary_1.getBinaryNodeChild)(result, 'group');
267
- const descChild = (0, WABinary_1.getBinaryNodeChild)(group, 'description');
266
+ const group = WABinary_1.getBinaryNodeChild(result, 'group');
267
+ const descChild = WABinary_1.getBinaryNodeChild(group, 'description');
268
268
  let desc;
269
269
  let descId;
270
270
  let descOwner;
271
271
  let descOwnerLid;
272
272
  let descTime;
273
273
  if (descChild) {
274
- desc = (0, WABinary_1.getBinaryNodeChildString)(descChild, 'body');
275
- descOwner = (0, WABinary_1.jidNormalizedUser)(descChild.attrs.participant_pn || descChild.attrs.participant);
274
+ desc = WABinary_1.getBinaryNodeChildString(descChild, 'body');
275
+ descOwner = WABinary_1.jidNormalizedUser(descChild.attrs.participant_pn || descChild.attrs.participant);
276
276
  if (group.attrs.addressing_mode === 'lid') {
277
- descOwnerLid = (0, WABinary_1.jidNormalizedUser)(descChild.attrs.participant);
277
+ descOwnerLid = WABinary_1.jidNormalizedUser(descChild.attrs.participant);
278
278
  }
279
279
  descId = descChild.attrs.id;
280
280
  descTime = descChild.attrs.t ? +descChild.attrs.t : undefined;
281
281
  }
282
282
  const groupSize = group.attrs.size ? Number(group.attrs.size) : undefined;
283
283
  const groupId = group.attrs.id.includes('@') ? group.attrs.id : (0, WABinary_1.jidEncode)(group.attrs.id, 'g.us');
284
- const eph = (_a = (0, WABinary_1.getBinaryNodeChild)(group, 'ephemeral')) === null || _a === void 0 ? void 0 : _a.attrs.expiration;
285
- const memberAddMode = (0, WABinary_1.getBinaryNodeChildString)(group, 'member_add_mode') === 'all_member_add';
284
+ const eph = WABinary_1.getBinaryNodeChild(group, 'ephemeral')?.attrs.expiration
285
+ const memberAddMode = WABinary_1.getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add';
286
286
  const metadata = {
287
287
  id: groupId,
288
288
  addressingMode: group.attrs.addressing_mode,
289
289
  subject: group.attrs.subject,
290
- subjectOwner: (0, WABinary_1.jidNormalizedUser)(group.attrs.s_o_pn || group.attrs.s_o),
291
- ...(group.attrs.addressing_mode === 'lid' ? { subjectOwnerLid: (0, WABinary_1.jidNormalizedUser)(group.attrs.s_o) } : {}),
290
+ subjectOwner: WABinary_1.jidNormalizedUser(group.attrs.s_o_pn || group.attrs.s_o),
291
+ ...(group.attrs.addressing_mode === 'lid' ? { subjectOwnerLid: WABinary_1.jidNormalizedUser(group.attrs.s_o) } : {}),
292
292
  subjectTime: group.attrs.s_t ? +group.attrs.s_t : undefined,
293
- size: groupSize || (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').length,
293
+ size: groupSize || WABinary_1.getBinaryNodeChildren(group, 'participant').length,
294
294
  creation: group.attrs.creation ? +group.attrs.creation : undefined,
295
- owner: (0, WABinary_1.jidNormalizedUser)(group.attrs.creator_pn || group.attrs.creator),
296
- ...(group.attrs.addressing_mode === 'lid' ? { ownerLid: (0, WABinary_1.jidNormalizedUser)(group.attrs.creator) } : {}),
295
+ owner: WABinary_1.jidNormalizedUser(group.attrs.creator_pn || group.attrs.creator),
296
+ ...(group.attrs.addressing_mode === 'lid' ? { ownerLid: WABinary_1.jidNormalizedUser(group.attrs.creator) } : {}),
297
297
  descOwner,
298
298
  descOwnerLid,
299
- restrict: !!(0, WABinary_1.getBinaryNodeChild)(group, 'locked'),
300
- announce: !!(0, WABinary_1.getBinaryNodeChild)(group, 'announcement'),
301
- isCommunity: !!(0, WABinary_1.getBinaryNodeChild)(group, 'parent'),
302
- isCommunityAnnounce: !!(0, WABinary_1.getBinaryNodeChild)(group, 'default_sub_group'),
303
- joinApprovalMode: !!(0, WABinary_1.getBinaryNodeChild)(group, 'membership_approval_mode'),
299
+ restrict: !!WABinary_1.getBinaryNodeChild(group, 'locked'),
300
+ announce: !!WABinary_1.getBinaryNodeChild(group, 'announcement'),
301
+ isCommunity: !!WABinary_1.getBinaryNodeChild(group, 'parent'),
302
+ isCommunityAnnounce: !!WABinary_1.getBinaryNodeChild(group, 'default_sub_group'),
303
+ joinApprovalMode: !!WABinary_1.getBinaryNodeChild(group, 'membership_approval_mode'),
304
304
  memberAddMode,
305
- participants: (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').map(({ attrs }) => {
305
+ participants: WABinary_1.getBinaryNodeChildren(group, 'participant').map(({ attrs }) => {
306
306
  return {
307
307
  id: attrs.jid,
308
308
  jid: attrs.phone_number || attrs.jid,
@@ -8,3 +8,4 @@ const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
8
8
  ...config
9
9
  }));
10
10
  exports.default = makeWASocket;
11
+ exports.makeWASocket = makeWASocket;
@@ -6,10 +6,9 @@ import { BinaryNode, JidWithDevice } from '../WABinary';
6
6
  export declare const makeMessagesSocket: (config: SocketConfig) => {
7
7
  getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
8
8
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
9
- relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
9
+ relayMessage: (jid: string, message: proto.IMessage, { messageId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<proto.WebMessageInfo>;
10
10
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
11
11
  sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
12
- getButtonArgs: (message: proto.IMessage) => BinaryNode['attrs'];
13
12
  readMessages: (keys: WAMessageKey[]) => Promise<void>;
14
13
  refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
15
14
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
@@ -22,6 +21,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
22
21
  [_: string]: string;
23
22
  }>;
24
23
  sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
24
+ rahmi: any;
25
25
  updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
26
26
  sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
27
27
  subscribeNewsletterUpdates: (jid: string) => Promise<{