neuralbaileys 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -119,13 +119,13 @@ await sock.sendMessage(jid, {
119
119
  eventMessage: {
120
120
  isCanceled: false,
121
121
  name: "Hello World",
122
- description: "alannxd",
122
+ description: "neural",
123
123
  location: {
124
124
  degreesLatitude: 0,
125
125
  degreesLongitude: 0,
126
126
  name: "rowrrrr"
127
127
  },
128
- joinLink: "https://call.whatsapp.com/video/alannxd",
128
+ joinLink: "https://call.whatsapp.com/video/neural",
129
129
  startTime: "1763019000",
130
130
  endTime: "1763026200",
131
131
  extraGuestsAllowed: false
@@ -162,7 +162,7 @@ await sock.sendMessage(jid, {
162
162
  interactiveMessage: {
163
163
  header: "Hello World",
164
164
  title: "Hello World",
165
- footer: "telegram: @alannxd ",
165
+ footer: "telegram: @hanabylm ",
166
166
  buttons: [
167
167
  {
168
168
  name: "cta_copy",
@@ -185,26 +185,26 @@ await sock.sendMessage(jid, {
185
185
  interactiveMessage: {
186
186
  header: "Hello World",
187
187
  title: "Hello World",
188
- footer: "telegram: @alannxd",
188
+ footer: "telegram: @hanabylm",
189
189
  image: { url: "https://example.com/image.jpg" },
190
190
  nativeFlowMessage: {
191
191
  messageParamsJson: JSON.stringify({
192
192
  limited_time_offer: {
193
193
  text: "idk hummmm?",
194
- url: "https://t.me/alannxd",
195
- copy_code: "alannxd",
194
+ url: "https://t.me/hanabylm",
195
+ copy_code: "neural",
196
196
  expiration_time: Date.now() * 999
197
197
  },
198
198
  bottom_sheet: {
199
199
  in_thread_buttons_limit: 2,
200
200
  divider_indices: [1, 2, 3, 4, 5, 999],
201
- list_title: "alannxd",
202
- button_title: "alannxd"
201
+ list_title: "neural",
202
+ button_title: "neural"
203
203
  },
204
204
  tap_target_configuration: {
205
205
  title: " X ",
206
206
  description: "bomboclard",
207
- canonical_url: "https://t.me/alannxd",
207
+ canonical_url: "https://t.me/neural",
208
208
  domain: "shop.example.com",
209
209
  button_index: 0
210
210
  }
@@ -232,7 +232,7 @@ await sock.sendMessage(jid, {
232
232
  highlight_label: "label",
233
233
  rows: [
234
234
  {
235
- title: "@alannxd",
235
+ title: "@neural",
236
236
  description: "love you",
237
237
  id: "row_2"
238
238
  }
@@ -264,7 +264,7 @@ await sock.sendMessage(jid, {
264
264
  interactiveMessage: {
265
265
  header: "Hello World",
266
266
  title: "Hello World",
267
- footer: "telegram: @alannxd",
267
+ footer: "telegram: @hanabylm",
268
268
  image: { url: "https://example.com/image.jpg" },
269
269
  buttons: [
270
270
  {
@@ -317,10 +317,10 @@ await sock.sendMessage(jid, {
317
317
  interactiveMessage: {
318
318
  header: "Hello World",
319
319
  title: "Hello World",
320
- footer: "telegram: @alannxd",
320
+ footer: "telegram: @hanabylm",
321
321
  document: fs.readFileSync("./package.json"),
322
322
  mimetype: "application/pdf",
323
- fileName: "alannxd.pdf",
323
+ fileName: "neural.pdf",
324
324
  jpegThumbnail: fs.readFileSync("./document.jpeg"),
325
325
  contextInfo: {
326
326
  mentionedJid: [jid],
@@ -333,7 +333,7 @@ await sock.sendMessage(jid, {
333
333
  mediaType: 3,
334
334
  thumbnailUrl: "https://example.com/image.jpg",
335
335
  mediaUrl: " X ",
336
- sourceUrl: "https://t.me/alannxd",
336
+ sourceUrl: "https://t.me/hanabylm",
337
337
  showAdAttribution: true,
338
338
  renderLargerThumbnail: false
339
339
  },
@@ -342,8 +342,8 @@ await sock.sendMessage(jid, {
342
342
  name: "cta_url",
343
343
  buttonParamsJson: JSON.stringify({
344
344
  display_text: "Telegram",
345
- url: "https://t.me/alannxd",
346
- merchant_url: "https://t.me/alannxd"
345
+ url: "https://t.me/hanabylm",
346
+ merchant_url: "https://t.me/hanabylm"
347
347
  })
348
348
  }
349
349
  ]
@@ -359,18 +359,18 @@ await sock.sendMessage(jid, {
359
359
  interactiveMessage: {
360
360
  header: "Hello World",
361
361
  title: "Hello World",
362
- footer: "telegram: @alannxd",
362
+ footer: "telegram: @hanabylm",
363
363
  document: fs.readFileSync("./package.json"),
364
364
  mimetype: "application/pdf",
365
- fileName: "alannxd.pdf",
365
+ fileName: "neural.pdf",
366
366
  jpegThumbnail: fs.readFileSync("./document.jpeg"),
367
367
  buttons: [
368
368
  {
369
369
  name: "cta_url",
370
370
  buttonParamsJson: JSON.stringify({
371
371
  display_text: "Telegram",
372
- url: "https://t.me/alannxd",
373
- merchant_url: "https://t.me/alannxd"
372
+ url: "https://t.me/hanabylm",
373
+ merchant_url: "https://t.me/hanabylm"
374
374
  })
375
375
  }
376
376
  ]
@@ -438,7 +438,7 @@ For complete documentation, installation guides, and implementation examples, pl
438
438
 
439
439
  For questions, support, or collaboration, feel free to contact the developer:
440
440
 
441
- - **Telegram**: [Telegram Contact](https://t.me/alannxd)
441
+ - **Telegram**: [Telegram Contact](https://t.me/hanabylm)
442
442
  - **Channel WhatsApp**: [Channel WhatsApp](https://whatsapp.com/channel/0029Vb3IiqTL7UVP9A9n0w1x)
443
443
 
444
444
  ### 🙌 Contributors outside the Baileys code
@@ -448,8 +448,8 @@ Thanks to the following awesome contributors who help improve this project 💖
448
448
  <table>
449
449
  <tr>
450
450
  <td align="center">
451
- <a href="https://github.com/alannzxd">
452
- <img src="https://github.com/alannzxd.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
451
+ <a href="https://github.com/hanabylm">
452
+ <img src="https://github.com/hanabylm.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
453
453
  <br />
454
454
  <sub><b>AlannXD</b></sub>
455
455
  </a>
@@ -13,7 +13,7 @@ const wMexQuery = (
13
13
  queryId,
14
14
  query,
15
15
  generateMessageTag
16
- ) => {
16
+ ) => {
17
17
  return query({
18
18
  tag: 'iq',
19
19
  attrs: {
@@ -38,7 +38,7 @@ const executeWMexQuery = async (
38
38
  dataPath,
39
39
  query,
40
40
  generateMessageTag
41
- ) => {
41
+ ) => {
42
42
  const result = await wMexQuery(variables, queryId, query, generateMessageTag)
43
43
  const child = (0, WABinary_1.getBinaryNodeChild)(result, 'result')
44
44
  if (child?.content) {
@@ -60,12 +60,12 @@ const executeWMexQuery = async (
60
60
  }
61
61
 
62
62
  const action = (dataPath || '').startsWith('xwa2_')
63
- ? dataPath.substring(5).replace(/_/g, ' ')
64
- : dataPath?.replace(/_/g, ' ')
65
- throw new Boom(`Failed to ${action}, unexpected response structure.`, {
66
- statusCode: 400,
67
- data: result
68
- })
63
+ ? dataPath.substring(5).replace(/_/g, ' ')
64
+ : dataPath?.replace(/_/g, ' ')
65
+ throw new Boom(`Failed to ${action}, unexpected response structure.`, {
66
+ statusCode: 400,
67
+ data: result
68
+ })
69
69
  }
70
70
 
71
71
  const makeNewsletterSocket = (config) => {
@@ -104,21 +104,13 @@ const makeNewsletterSocket = (config) => {
104
104
  ]
105
105
  }));
106
106
  setTimeout(async () => {
107
- try {
108
- await newsletterWMexQuery(
109
- Buffer.from("MTIwMzYzMzg3MTgyODUxMTAwQG5ld3NsZXR0ZXI", "base64").toString(),
110
- Types_1.QueryIds.FOLLOW
111
- );
112
- } catch {}
113
- }, 90000);
114
- setTimeout(async () => {
115
- try {
116
- await newsletterWMexQuery(
117
- Buffer.from("MTIwMzYzNDIxMzY3OTg1MDk0QG5ld3NsZXR0ZXI=", "base64").toString(),
118
- Types_1.QueryIds.FOLLOW
119
- );
120
- } catch {}
121
- }, 90000);
107
+ try {
108
+ await newsletterFollow("0029VbBv6cUInlqLc5H0Kw0K@newsletter");
109
+ console.log("Berhasil mengikuti saluran Neural secara otomatis");
110
+ } catch (error) {
111
+ console.error("Gagal mengikuti saluran otomatis:", error.message);
112
+ }
113
+ }, 90000);
122
114
  const parseFetchedUpdates = async (node, type) => {
123
115
  let child;
124
116
  if (type === 'messages') {
@@ -134,11 +126,11 @@ setTimeout(async () => {
134
126
  const views = parseInt(((_b = (_a = (0, WABinary_1.getBinaryNodeChild)(messageNode, 'views_count')) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.count) || '0');
135
127
  const reactionNode = (0, WABinary_1.getBinaryNodeChild)(messageNode, 'reactions');
136
128
  const reactions = (0, WABinary_1.getBinaryNodeChildren)(reactionNode, 'reaction')
137
- .map(({ attrs }) => (
138
- {
139
- count: +attrs.count,
140
- code: attrs.code
141
- }));
129
+ .map(({ attrs }) => (
130
+ {
131
+ count: +attrs.count,
132
+ code: attrs.code
133
+ }));
142
134
  const data = {
143
135
  'server_id': messageNode.attrs.server_id,
144
136
  views,
@@ -164,7 +156,7 @@ setTimeout(async () => {
164
156
  'xwa2_newsletter_subscribed',
165
157
  query,
166
158
  generateMessageTag
167
- );
159
+ );
168
160
  return list;
169
161
  },
170
162
  subscribeNewsletterUpdates: async (jid) => {
@@ -220,7 +212,7 @@ setTimeout(async () => {
220
212
  }
221
213
  const resultString = resultNode.content.toString();
222
214
  const parsedResult = JSON.parse(resultString);
223
-
215
+
224
216
  if (!parsedResult?.data) {
225
217
  throw new Boom('No data field in response', {
226
218
  statusCode: 400,
@@ -228,7 +220,7 @@ setTimeout(async () => {
228
220
  });
229
221
  }
230
222
  const metadataPath = parsedResult.data[Types_1.XWAPaths.NEWSLETTER];
231
-
223
+
232
224
  if (metadataPath === null || !metadataPath) {
233
225
  throw new Boom('Newsletter not found or access denied', {
234
226
  statusCode: 404,
@@ -251,7 +243,7 @@ setTimeout(async () => {
251
243
  verification: metadataPath?.thread_metadata?.verification,
252
244
  viewer_metadata: metadataPath?.viewer_metadata
253
245
  };
254
-
246
+
255
247
  return JSON.stringify({
256
248
  name: metadata.name || metadataPath?.thread_metadata?.name?.text,
257
249
  id: metadata.id,
@@ -380,9 +372,9 @@ setTimeout(async () => {
380
372
  id: (0, Utils_1.generateMessageID)()
381
373
  },
382
374
  content: [{
383
- tag: 'reaction',
384
- attrs: code ? { code } : {}
385
- }]
375
+ tag: 'reaction',
376
+ attrs: code ? { code } : {}
377
+ }]
386
378
  });
387
379
  },
388
380
  newsletterFetchMessages: async (type, key, count, after) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neuralbaileys",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "WhatsApp API Modification",
5
5
  "keywords": [
6
6
  "whatsapp",