@badzz88/baileys 8.5.6 → 8.5.8

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 (225) hide show
  1. package/README.md +337 -1055
  2. package/WAProto/WAProto.proto +28 -1189
  3. package/WAProto/fix-imports.js +79 -69
  4. package/WAProto/index.d.ts +71491 -15254
  5. package/WAProto/index.js +126436 -19814
  6. package/engine-requirements.js +8 -15
  7. package/lib/Defaults/index.js +130 -0
  8. package/{src → lib}/Signal/Group/ciphertext-message.js +2 -5
  9. package/lib/Signal/Group/group-session-builder.js +30 -0
  10. package/{src → lib}/Signal/Group/group_cipher.js +11 -11
  11. package/lib/Signal/Group/index.js +12 -0
  12. package/lib/Signal/Group/keyhelper.js +18 -0
  13. package/{src → lib}/Signal/Group/sender-chain-key.js +6 -9
  14. package/{src → lib}/Signal/Group/sender-key-distribution-message.js +6 -9
  15. package/{src → lib}/Signal/Group/sender-key-message.js +9 -12
  16. package/{src → lib}/Signal/Group/sender-key-name.js +2 -5
  17. package/{src → lib}/Signal/Group/sender-key-record.js +8 -11
  18. package/{src → lib}/Signal/Group/sender-key-state.js +6 -9
  19. package/lib/Signal/Group/sender-message-key.js +26 -0
  20. package/{src → lib}/Signal/libsignal.js +131 -155
  21. package/{src → lib}/Signal/lid-mapping.js +27 -23
  22. package/lib/Socket/Client/index.js +3 -0
  23. package/lib/Socket/Client/types.js +11 -0
  24. package/{src → lib}/Socket/Client/websocket.js +11 -18
  25. package/{src → lib}/Socket/business.js +35 -67
  26. package/{src → lib}/Socket/chats.js +294 -550
  27. package/{src → lib}/Socket/communities.js +82 -114
  28. package/lib/Socket/graphql.js +716 -0
  29. package/lib/Socket/groups.js +374 -0
  30. package/lib/Socket/index.js +18 -0
  31. package/lib/Socket/interop.js +463 -0
  32. package/{src → lib}/Socket/luxu.js +120 -82
  33. package/lib/Socket/messages-recv.js +1916 -0
  34. package/lib/Socket/messages-send.js +1436 -0
  35. package/lib/Socket/mex.js +54 -0
  36. package/lib/Socket/newsletter.js +757 -0
  37. package/lib/Socket/privacy.js +318 -0
  38. package/{src → lib}/Socket/socket.js +356 -244
  39. package/lib/Socket/username.js +236 -0
  40. package/lib/Store/index.js +10 -0
  41. package/{src → lib}/Store/keyed-db.js +11 -21
  42. package/lib/Store/make-cache-manager-store.js +85 -0
  43. package/lib/Store/make-in-memory-store.js +244 -0
  44. package/{src → lib}/Store/make-ordered-dictionary.js +19 -25
  45. package/{src → lib}/Store/object-repository.js +11 -5
  46. package/lib/Types/Auth.js +2 -0
  47. package/lib/Types/Bussines.js +2 -0
  48. package/lib/Types/Call.js +2 -0
  49. package/lib/Types/Chat.js +8 -0
  50. package/lib/Types/Contact.js +2 -0
  51. package/lib/Types/Events.js +2 -0
  52. package/lib/Types/GroupMetadata.js +2 -0
  53. package/lib/Types/Label.js +25 -0
  54. package/lib/Types/LabelAssociation.js +7 -0
  55. package/lib/Types/Message.js +11 -0
  56. package/lib/Types/Mex.js +111 -0
  57. package/lib/Types/Product.js +2 -0
  58. package/lib/Types/Signal.js +2 -0
  59. package/lib/Types/Socket.js +3 -0
  60. package/lib/Types/State.js +56 -0
  61. package/lib/Types/USync.js +2 -0
  62. package/lib/Types/index.js +26 -0
  63. package/{src → lib}/Utils/auth-utils.js +91 -43
  64. package/lib/Utils/browser-utils.js +48 -0
  65. package/lib/Utils/business.js +231 -0
  66. package/lib/Utils/chat-utils.js +872 -0
  67. package/lib/Utils/companion-reg-client-utils.js +35 -0
  68. package/lib/Utils/crypto.js +118 -0
  69. package/lib/Utils/decode-wa-message.js +350 -0
  70. package/{src → lib}/Utils/event-buffer.js +81 -39
  71. package/lib/Utils/generics.js +403 -0
  72. package/lib/Utils/history.js +134 -0
  73. package/{src → lib}/Utils/identity-change-handler.js +9 -11
  74. package/lib/Utils/index.js +23 -0
  75. package/lib/Utils/link-preview.js +85 -0
  76. package/lib/Utils/logger.js +3 -0
  77. package/lib/Utils/lt-hash.js +8 -0
  78. package/{src → lib}/Utils/make-mutex.js +7 -10
  79. package/lib/Utils/message-composer.js +273 -0
  80. package/{src → lib}/Utils/message-retry-manager.js +76 -28
  81. package/lib/Utils/messages-media.js +870 -0
  82. package/lib/Utils/messages.js +1337 -0
  83. package/lib/Utils/noise-handler.js +201 -0
  84. package/{src → lib}/Utils/offline-node-processor.js +10 -4
  85. package/{src → lib}/Utils/pre-key-manager.js +27 -11
  86. package/lib/Utils/process-message.js +630 -0
  87. package/{src → lib}/Utils/reporting-utils.js +12 -15
  88. package/lib/Utils/signal.js +201 -0
  89. package/{src → lib}/Utils/stanza-ack.js +12 -4
  90. package/lib/Utils/sticker.js +110 -0
  91. package/{src → lib}/Utils/sync-action-utils.js +14 -10
  92. package/{src → lib}/Utils/tc-token-utils.js +48 -43
  93. package/{src → lib}/Utils/use-multi-file-auth-state.js +35 -25
  94. package/lib/Utils/validate-connection.js +203 -0
  95. package/{src → lib}/WABinary/constants.js +9 -12
  96. package/{src → lib}/WABinary/decode.js +38 -118
  97. package/{src → lib}/WABinary/encode.js +6 -11
  98. package/lib/WABinary/generic-utils.js +204 -0
  99. package/lib/WABinary/index.js +6 -0
  100. package/lib/WABinary/jid-utils.js +98 -0
  101. package/lib/WABinary/types.js +2 -0
  102. package/{src → lib}/WAM/BinaryInfo.js +2 -5
  103. package/{src → lib}/WAM/constants.js +4 -16635
  104. package/{src → lib}/WAM/encode.js +18 -17
  105. package/lib/WAM/index.js +4 -0
  106. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +53 -0
  107. package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +43 -0
  108. package/lib/WAUSync/Protocols/USyncContactProtocol.js +54 -0
  109. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  110. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  111. package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +58 -0
  112. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +30 -0
  113. package/lib/WAUSync/Protocols/USyncPictureProtocol.js +32 -0
  114. package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +28 -0
  115. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +39 -0
  116. package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +38 -0
  117. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +27 -0
  118. package/lib/WAUSync/Protocols/index.js +12 -0
  119. package/lib/WAUSync/USyncQuery.js +151 -0
  120. package/lib/WAUSync/USyncUser.js +56 -0
  121. package/lib/WAUSync/index.js +3 -0
  122. package/{src → lib}/index.js +16 -51
  123. package/package.json +129 -99
  124. package/LICENSE +0 -21
  125. package/src/Defaults/index.js +0 -186
  126. package/src/Defaults/phonenumber-mcc.json +0 -223
  127. package/src/Signal/Group/group-session-builder.js +0 -86
  128. package/src/Signal/Group/index.js +0 -140
  129. package/src/Signal/Group/keyhelper.js +0 -77
  130. package/src/Signal/Group/sender-message-key.js +0 -29
  131. package/src/Socket/Client/index.js +0 -31
  132. package/src/Socket/Client/types.js +0 -13
  133. package/src/Socket/aigroups.js +0 -221
  134. package/src/Socket/graphql.js +0 -523
  135. package/src/Socket/groups.js +0 -516
  136. package/src/Socket/index.js +0 -31
  137. package/src/Socket/interactive-handler.js +0 -527
  138. package/src/Socket/interop.js +0 -339
  139. package/src/Socket/managed-account.js +0 -98
  140. package/src/Socket/messages-recv.js +0 -2685
  141. package/src/Socket/messages-send.js +0 -2047
  142. package/src/Socket/mex.js +0 -57
  143. package/src/Socket/newsletter.js +0 -455
  144. package/src/Socket/privacy.js +0 -125
  145. package/src/Socket/registration.js +0 -236
  146. package/src/Socket/text-router.js +0 -65
  147. package/src/Socket/username.js +0 -130
  148. package/src/Store/index.js +0 -33
  149. package/src/Store/make-cache-manager-store.js +0 -84
  150. package/src/Store/make-in-memory-store.js +0 -551
  151. package/src/Types/Auth.js +0 -31
  152. package/src/Types/Bussines.js +0 -2
  153. package/src/Types/Call.js +0 -2
  154. package/src/Types/Chat.js +0 -4
  155. package/src/Types/Contact.js +0 -2
  156. package/src/Types/Events.js +0 -2
  157. package/src/Types/GroupMetadata.js +0 -2
  158. package/src/Types/Label.js +0 -26
  159. package/src/Types/LabelAssociation.js +0 -8
  160. package/src/Types/Message.js +0 -93
  161. package/src/Types/Mex.js +0 -112
  162. package/src/Types/Newsletter.js +0 -109
  163. package/src/Types/Product.js +0 -2
  164. package/src/Types/Signal.js +0 -2
  165. package/src/Types/Socket.js +0 -2
  166. package/src/Types/State.js +0 -62
  167. package/src/Types/USync.js +0 -2
  168. package/src/Types/index.js +0 -56
  169. package/src/Utils/browser-utils.js +0 -112
  170. package/src/Utils/business.js +0 -240
  171. package/src/Utils/chat-utils.js +0 -1230
  172. package/src/Utils/command-loader.d.ts +0 -27
  173. package/src/Utils/command-loader.js +0 -89
  174. package/src/Utils/companion-reg-client-utils.js +0 -40
  175. package/src/Utils/consumer-application.js +0 -105
  176. package/src/Utils/crypto.js +0 -118
  177. package/src/Utils/curve25519-js.js +0 -242
  178. package/src/Utils/decode-wa-message.js +0 -529
  179. package/src/Utils/generics.js +0 -483
  180. package/src/Utils/group-history.js +0 -44
  181. package/src/Utils/history.js +0 -232
  182. package/src/Utils/index.js +0 -58
  183. package/src/Utils/jid-display-normalization.js +0 -195
  184. package/src/Utils/link-preview.js +0 -135
  185. package/src/Utils/logger.js +0 -8
  186. package/src/Utils/lt-hash.js +0 -25
  187. package/src/Utils/message-composer.js +0 -471
  188. package/src/Utils/messages-media.js +0 -843
  189. package/src/Utils/messages.js +0 -2817
  190. package/src/Utils/meta-ai-msmsg.js +0 -222
  191. package/src/Utils/native-bridge.js +0 -68
  192. package/src/Utils/noise-handler.js +0 -169
  193. package/src/Utils/process-message.js +0 -950
  194. package/src/Utils/session-pool.d.ts +0 -14
  195. package/src/Utils/session-pool.js +0 -70
  196. package/src/Utils/signal.js +0 -217
  197. package/src/Utils/sticker.d.ts +0 -13
  198. package/src/Utils/sticker.js +0 -123
  199. package/src/Utils/validate-connection.js +0 -209
  200. package/src/Utils/view-once-cache.d.ts +0 -12
  201. package/src/Utils/view-once-cache.js +0 -63
  202. package/src/Utils/voip-rekey.js +0 -22
  203. package/src/WABinary/generic-utils.js +0 -238
  204. package/src/WABinary/index.js +0 -34
  205. package/src/WABinary/jid-utils.js +0 -351
  206. package/src/WABinary/types.js +0 -2
  207. package/src/WAM/index.js +0 -32
  208. package/src/WAUSync/Protocols/USyncBotProfileProtocol.js +0 -53
  209. package/src/WAUSync/Protocols/USyncBusinessProtocol.js +0 -44
  210. package/src/WAUSync/Protocols/USyncContactProtocol.js +0 -55
  211. package/src/WAUSync/Protocols/USyncDeviceProtocol.js +0 -55
  212. package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -31
  213. package/src/WAUSync/Protocols/USyncFeatureProtocol.js +0 -54
  214. package/src/WAUSync/Protocols/USyncLIDProtocol.js +0 -32
  215. package/src/WAUSync/Protocols/USyncNewsletterProtocol.js +0 -473
  216. package/src/WAUSync/Protocols/USyncPictureProtocol.js +0 -34
  217. package/src/WAUSync/Protocols/USyncSidelistProtocol.js +0 -29
  218. package/src/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
  219. package/src/WAUSync/Protocols/USyncTextStatusProtocol.js +0 -38
  220. package/src/WAUSync/Protocols/USyncUsernameProtocol.js +0 -28
  221. package/src/WAUSync/Protocols/index.js +0 -40
  222. package/src/WAUSync/USyncQuery.js +0 -126
  223. package/src/WAUSync/USyncUser.js +0 -50
  224. package/src/WAUSync/index.js +0 -32
  225. package/src/antiban.js +0 -4152
@@ -1,47 +1,42 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import * as Utils from '../Utils/index.js';
3
- import crypto from 'crypto';
1
+ import { proto } from '../../WAProto/index.js'
2
+ import * as Utils from '../Utils/index.js'
3
+ import crypto from 'crypto'
4
+
4
5
  export default class imup {
5
6
  constructor(utils, waUploadToServer, relayMessageFn) {
6
- this.utils = utils;
7
- this.relayMessage = relayMessageFn;
8
- this.waUploadToServer = waUploadToServer;
7
+ this.utils = utils
8
+ this.relayMessage = relayMessageFn
9
+ this.waUploadToServer = waUploadToServer
9
10
  }
11
+
10
12
  detectType(content) {
11
- if (content.requestPaymentMessage)
12
- return 'PAYMENT';
13
- if (content.productMessage)
14
- return 'PRODUCT';
15
- if (content.albumMessage)
16
- return 'ALBUM';
17
- if (content.eventMessage)
18
- return 'EVENT';
19
- if (content.pollResultMessage)
20
- return 'POLL_RESULT';
21
- if (content.orderMessage)
22
- return 'ORDER';
23
- if (content.groupStatus)
24
- return 'GROUP_STATUS';
25
- if (content.groupLabel)
26
- return 'GROUP_LABEL';
27
- return null;
13
+ if (content.requestPaymentMessage) return 'PAYMENT'
14
+ if (content.productMessage) return 'PRODUCT'
15
+ if (content.albumMessage) return 'ALBUM'
16
+ if (content.eventMessage) return 'EVENT'
17
+ if (content.pollResultMessage) return 'POLL_RESULT'
18
+ if (content.orderMessage) return 'ORDER'
19
+ if (content.groupStatus) return 'GROUP_STATUS'
20
+ if (content.groupLabel) return 'GROUP_LABEL'
21
+ return null
28
22
  }
23
+
29
24
  async handlePayment(content, quoted) {
30
- const data = content.requestPaymentMessage;
31
- let notes = {};
25
+ const data = content.requestPaymentMessage
26
+ let notes = {}
27
+
32
28
  if (data.sticker?.stickerMessage) {
33
29
  notes = {
34
30
  stickerMessage: {
35
- ...data.sticker.stickerMessage,
31
+ ...data.sticker.stickerMessage,
36
32
  contextInfo: {
37
33
  stanzaId: quoted?.key?.id,
38
34
  participant: quoted?.key?.participant || content.sender,
39
35
  quotedMessage: quoted?.message
40
36
  }
41
37
  }
42
- };
43
- }
44
- else if (data.note) {
38
+ }
39
+ } else if (data.note) {
45
40
  notes = {
46
41
  extendedTextMessage: {
47
42
  text: data.note,
@@ -51,8 +46,9 @@ export default class imup {
51
46
  quotedMessage: quoted?.message
52
47
  }
53
48
  }
54
- };
49
+ }
55
50
  }
51
+
56
52
  return {
57
53
  requestPaymentMessage: proto.Message.RequestPaymentMessage.fromObject({
58
54
  expiryTimestamp: data.expiry || 0,
@@ -60,24 +56,45 @@ export default class imup {
60
56
  currencyCodeIso4217: data.currency || "IDR",
61
57
  requestFrom: data.from || "0@s.whatsapp.net",
62
58
  noteMessage: notes,
63
- background: data.background ?? {
59
+ background: data.background?? {
64
60
  id: "DEFAULT",
65
61
  placeholderArgb: 0xFFF0F0F0
66
62
  }
67
63
  })
68
- };
64
+ }
69
65
  }
66
+
70
67
  async handleProduct(content, jid, quoted) {
71
- const { title, description, thumbnail, productId, retailerId, url, body = "", footer = "", buttons = [], priceAmount1000 = null, currencyCode = "IDR" } = content.productMessage;
72
- let productImage;
68
+ const {
69
+ title,
70
+ description,
71
+ thumbnail,
72
+ productId,
73
+ retailerId,
74
+ url,
75
+ body = "",
76
+ footer = "",
77
+ buttons = [],
78
+ priceAmount1000 = null,
79
+ currencyCode = "IDR"
80
+ } = content.productMessage
81
+
82
+ let productImage
83
+
73
84
  if (Buffer.isBuffer(thumbnail)) {
74
- const { imageMessage } = await this.utils.generateWAMessageContent({ image: thumbnail }, { upload: this.waUploadToServer });
75
- productImage = imageMessage;
76
- }
77
- else if (typeof thumbnail === 'object' && thumbnail.url) {
78
- const { imageMessage } = await this.utils.generateWAMessageContent({ image: { url: thumbnail.url } }, { upload: this.waUploadToServer });
79
- productImage = imageMessage;
85
+ const { imageMessage } = await this.utils.generateWAMessageContent(
86
+ { image: thumbnail },
87
+ { upload: this.waUploadToServer }
88
+ )
89
+ productImage = imageMessage
90
+ } else if (typeof thumbnail === 'object' && thumbnail.url) {
91
+ const { imageMessage } = await this.utils.generateWAMessageContent(
92
+ { image: { url: thumbnail.url } },
93
+ { upload: this.waUploadToServer }
94
+ )
95
+ productImage = imageMessage
80
96
  }
97
+
81
98
  return {
82
99
  viewOnceMessage: {
83
100
  message: {
@@ -106,10 +123,11 @@ export default class imup {
106
123
  }
107
124
  }
108
125
  }
109
- };
126
+ }
110
127
  }
128
+
111
129
  async handleAlbum(content, jid, quoted) {
112
- const array = content.albumMessage;
130
+ const array = content.albumMessage
113
131
  const album = await this.utils.generateWAMessageFromContent(jid, {
114
132
  messageContextInfo: {
115
133
  messageSecret: crypto.randomBytes(32),
@@ -122,14 +140,17 @@ export default class imup {
122
140
  userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
123
141
  quoted,
124
142
  upload: this.waUploadToServer
125
- });
143
+ })
144
+
126
145
  await this.relayMessage(jid, album.message, {
127
146
  messageId: album.key.id,
128
- });
147
+ })
148
+
129
149
  for (let content of array) {
130
150
  const img = await this.utils.generateWAMessage(jid, content, {
131
151
  upload: this.waUploadToServer,
132
- });
152
+ })
153
+
133
154
  img.message.messageContextInfo = {
134
155
  messageSecret: crypto.randomBytes(32),
135
156
  messageAssociation: {
@@ -150,7 +171,8 @@ export default class imup {
150
171
  dataSharingContext: {
151
172
  showMmDisclosure: true,
152
173
  },
153
- };
174
+ }
175
+
154
176
  img.message.forwardedNewsletterMessageInfo = {
155
177
  newsletterJid: "0@newsletter",
156
178
  serverMessageId: 1,
@@ -161,7 +183,8 @@ export default class imup {
161
183
  contentType: "UPDATE_CARD",
162
184
  priority: "high",
163
185
  status: "sent",
164
- };
186
+ }
187
+
165
188
  img.message.disappearingMode = {
166
189
  initiator: 3,
167
190
  trigger: 4,
@@ -175,7 +198,8 @@ export default class imup {
175
198
  initiatedByApp: true,
176
199
  initiatedByBot: true,
177
200
  initiatedByMe: true,
178
- };
201
+ }
202
+
179
203
  await this.relayMessage(jid, img.message, {
180
204
  messageId: img.key.id,
181
205
  quoted: {
@@ -187,12 +211,14 @@ export default class imup {
187
211
  },
188
212
  message: album.message,
189
213
  },
190
- });
214
+ })
191
215
  }
192
- return album;
216
+ return album
193
217
  }
218
+
194
219
  async handleEvent(content, jid, quoted) {
195
- const eventData = content.eventMessage;
220
+ const eventData = content.eventMessage
221
+
196
222
  const msg = await this.utils.generateWAMessageFromContent(jid, {
197
223
  viewOnceMessage: {
198
224
  message: {
@@ -227,27 +253,29 @@ export default class imup {
227
253
  name: "Location"
228
254
  },
229
255
  joinLink: eventData.joinLink || '',
230
- startTime: typeof eventData.startTime === 'string' ? parseInt(eventData.startTime) : eventData.startTime || Date.now(),
231
- endTime: typeof eventData.endTime === 'string' ? parseInt(eventData.endTime) : eventData.endTime || Date.now() + 3600000,
232
- extraGuestsAllowed: eventData.extraGuestsAllowed !== false
256
+ startTime: typeof eventData.startTime === 'string'? parseInt(eventData.startTime) : eventData.startTime || Date.now(),
257
+ endTime: typeof eventData.endTime === 'string'? parseInt(eventData.endTime) : eventData.endTime || Date.now() + 3600000,
258
+ extraGuestsAllowed: eventData.extraGuestsAllowed!== false
233
259
  }
234
260
  }
235
261
  }
236
- }, { quoted });
262
+ }, { quoted })
263
+
237
264
  await this.relayMessage(jid, msg.message, {
238
265
  messageId: msg.key.id
239
- });
240
- return msg;
266
+ })
267
+ return msg
241
268
  }
269
+
242
270
  async handlePollResult(content, jid, quoted) {
243
- const pollData = content.pollResultMessage;
271
+ const pollData = content.pollResultMessage
244
272
  const msg = await this.utils.generateWAMessageFromContent(jid, {
245
273
  pollResultSnapshotMessage: {
246
274
  name: pollData.name,
247
275
  pollVotes: pollData.pollVotes.map(vote => ({
248
276
  optionName: vote.optionName,
249
277
  optionVoteCount: typeof vote.optionVoteCount === 'number'
250
- ? vote.optionVoteCount.toString()
278
+ ? vote.optionVoteCount.toString()
251
279
  : vote.optionVoteCount
252
280
  })),
253
281
  contextInfo: {
@@ -264,14 +292,18 @@ export default class imup {
264
292
  }, {
265
293
  userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net',
266
294
  quoted
267
- });
295
+ })
296
+
268
297
  await this.relayMessage(jid, msg.message, {
269
298
  messageId: msg.key.id
270
- });
271
- return msg;
299
+ })
300
+
301
+ return msg
272
302
  }
303
+
273
304
  async handleOrderMessage(content, jid, quoted) {
274
- const orderData = content.orderMessage;
305
+ const orderData = content.orderMessage
306
+
275
307
  const Haha = await this.utils.generateWAMessageFromContent(jid, {
276
308
  orderMessage: {
277
309
  orderId: "7EPPELI25022008",
@@ -287,44 +319,49 @@ export default class imup {
287
319
  totalCurrencyCode: orderData.totalCurrencyCode || "IDR",
288
320
  messageVersion: 2
289
321
  }
290
- }, { quoted: quoted });
291
- await this.relayMessage(jid, Haha.message, {});
292
- return Haha;
322
+ }, { quoted: quoted })
323
+
324
+ await this.relayMessage(jid, Haha.message, {})
325
+ return Haha
293
326
  }
327
+
294
328
  async handleGroupStory(content, jid, quoted) {
295
- const storyData = content.groupStatus;
296
- let messageContent;
329
+ const storyData = content.groupStatus
330
+ let messageContent
331
+
297
332
  if (storyData.message) {
298
- messageContent = storyData;
299
- }
300
- else {
333
+ messageContent = storyData
334
+ } else {
301
335
  if (typeof this.utils?.generateWAMessageContent === "function") {
302
336
  messageContent = await this.utils.generateWAMessageContent(storyData, {
303
337
  upload: this.waUploadToServer
304
- });
305
- }
306
- else {
338
+ })
339
+ } else {
307
340
  messageContent = await Utils.generateWAMessageContent(storyData, {
308
341
  upload: this.waUploadToServer
309
- });
342
+ })
310
343
  }
311
344
  }
345
+
312
346
  let msg = {
313
347
  message: {
314
348
  groupStatusMessageV2: {
315
349
  message: messageContent.message || messageContent
316
350
  }
317
351
  }
318
- };
352
+ }
353
+
319
354
  return await this.relayMessage(jid, msg.message, {
320
355
  messageId: this.utils.generateMessageID()
321
- });
356
+ })
322
357
  }
358
+
323
359
  async handleGbLabel(content, jid) {
324
- const x = content.groupLabel;
360
+ const x = content.groupLabel
325
361
  if (!jid.endsWith('@g.us')) {
326
- throw new Error('group required!');
362
+ throw new Error('group required!')
327
363
  }
364
+
328
365
  const msg = this.utils.generateWAMessageFromContent(jid, {
329
366
  protocolMessage: {
330
367
  type: "GROUP_MEMBER_LABEL_CHANGE",
@@ -332,7 +369,8 @@ export default class imup {
332
369
  label: x.labelText.slice(0, 30)
333
370
  }
334
371
  }
335
- }, {});
372
+ }, {})
373
+
336
374
  await this.relayMessage(jid, msg.message, {
337
375
  additionalNodes: [
338
376
  {
@@ -344,6 +382,6 @@ export default class imup {
344
382
  content: undefined
345
383
  }
346
384
  ]
347
- });
385
+ })
348
386
  }
349
- }
387
+ }