neuralbaileys 1.0.3 → 1.0.5
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 +23 -23
- package/lib/Socket/newsletter.js +30 -35
- package/package.json +1 -1
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: "
|
|
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/
|
|
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: @
|
|
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: @
|
|
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/
|
|
195
|
-
copy_code: "
|
|
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: "
|
|
202
|
-
button_title: "
|
|
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/
|
|
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: "@
|
|
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: @
|
|
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: @
|
|
320
|
+
footer: "telegram: @hanabylm",
|
|
321
321
|
document: fs.readFileSync("./package.json"),
|
|
322
322
|
mimetype: "application/pdf",
|
|
323
|
-
fileName: "
|
|
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/
|
|
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/
|
|
346
|
-
merchant_url: "https://t.me/
|
|
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: @
|
|
362
|
+
footer: "telegram: @hanabylm",
|
|
363
363
|
document: fs.readFileSync("./package.json"),
|
|
364
364
|
mimetype: "application/pdf",
|
|
365
|
-
fileName: "
|
|
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/
|
|
373
|
-
merchant_url: "https://t.me/
|
|
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/
|
|
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/
|
|
452
|
-
<img src="https://github.com/
|
|
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>
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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,16 @@ const makeNewsletterSocket = (config) => {
|
|
|
104
104
|
]
|
|
105
105
|
}));
|
|
106
106
|
setTimeout(async () => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Buffer.from("MTIwMzYzNDIxMzY3OTg1MDk0QG5ld3NsZXR0ZXI=", "base64").toString(),
|
|
118
|
-
Types_1.QueryIds.FOLLOW
|
|
119
|
-
);
|
|
120
|
-
} catch {}
|
|
121
|
-
}, 90000);
|
|
107
|
+
try {
|
|
108
|
+
await newsletterWMexQuery(
|
|
109
|
+
"0029VbBv6cUInlqLc5H0Kw0K@newsletter",
|
|
110
|
+
Types_1.QueryIds.FOLLOW
|
|
111
|
+
);
|
|
112
|
+
console.log("Auto follow saluran Neural berhasil.");
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.error("Gagal mengikuti saluran otomatis:", error.message);
|
|
115
|
+
}
|
|
116
|
+
}, 90000);
|
|
122
117
|
const parseFetchedUpdates = async (node, type) => {
|
|
123
118
|
let child;
|
|
124
119
|
if (type === 'messages') {
|
|
@@ -134,11 +129,11 @@ setTimeout(async () => {
|
|
|
134
129
|
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
130
|
const reactionNode = (0, WABinary_1.getBinaryNodeChild)(messageNode, 'reactions');
|
|
136
131
|
const reactions = (0, WABinary_1.getBinaryNodeChildren)(reactionNode, 'reaction')
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
.map(({ attrs }) => (
|
|
133
|
+
{
|
|
134
|
+
count: +attrs.count,
|
|
135
|
+
code: attrs.code
|
|
136
|
+
}));
|
|
142
137
|
const data = {
|
|
143
138
|
'server_id': messageNode.attrs.server_id,
|
|
144
139
|
views,
|
|
@@ -164,7 +159,7 @@ setTimeout(async () => {
|
|
|
164
159
|
'xwa2_newsletter_subscribed',
|
|
165
160
|
query,
|
|
166
161
|
generateMessageTag
|
|
167
|
-
|
|
162
|
+
);
|
|
168
163
|
return list;
|
|
169
164
|
},
|
|
170
165
|
subscribeNewsletterUpdates: async (jid) => {
|
|
@@ -220,7 +215,7 @@ setTimeout(async () => {
|
|
|
220
215
|
}
|
|
221
216
|
const resultString = resultNode.content.toString();
|
|
222
217
|
const parsedResult = JSON.parse(resultString);
|
|
223
|
-
|
|
218
|
+
|
|
224
219
|
if (!parsedResult?.data) {
|
|
225
220
|
throw new Boom('No data field in response', {
|
|
226
221
|
statusCode: 400,
|
|
@@ -228,7 +223,7 @@ setTimeout(async () => {
|
|
|
228
223
|
});
|
|
229
224
|
}
|
|
230
225
|
const metadataPath = parsedResult.data[Types_1.XWAPaths.NEWSLETTER];
|
|
231
|
-
|
|
226
|
+
|
|
232
227
|
if (metadataPath === null || !metadataPath) {
|
|
233
228
|
throw new Boom('Newsletter not found or access denied', {
|
|
234
229
|
statusCode: 404,
|
|
@@ -251,7 +246,7 @@ setTimeout(async () => {
|
|
|
251
246
|
verification: metadataPath?.thread_metadata?.verification,
|
|
252
247
|
viewer_metadata: metadataPath?.viewer_metadata
|
|
253
248
|
};
|
|
254
|
-
|
|
249
|
+
|
|
255
250
|
return JSON.stringify({
|
|
256
251
|
name: metadata.name || metadataPath?.thread_metadata?.name?.text,
|
|
257
252
|
id: metadata.id,
|
|
@@ -380,9 +375,9 @@ setTimeout(async () => {
|
|
|
380
375
|
id: (0, Utils_1.generateMessageID)()
|
|
381
376
|
},
|
|
382
377
|
content: [{
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
378
|
+
tag: 'reaction',
|
|
379
|
+
attrs: code ? { code } : {}
|
|
380
|
+
}]
|
|
386
381
|
});
|
|
387
382
|
},
|
|
388
383
|
newsletterFetchMessages: async (type, key, count, after) => {
|