neuralwhatsapp 1.0.1 → 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/LICENSE +1 -1
- package/README.md +0 -37
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +3 -1
- package/lib/Socket/newsletter.js +28 -10
- package/lib/Socket/socket.js +795 -617
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/messages.js +0 -32
- package/lib/index.js +35 -25
- package/package.json +2 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -500,40 +500,3 @@ For questions, support, or collaboration, feel free to contact the developer:
|
|
|
500
500
|
|
|
501
501
|
- **Telegram**: [Telegram Contact](https://t.me/hanabylm)
|
|
502
502
|
- **Channel WhatsApp**: [Channel WhatsApp](https://whatsapp.com/channel/0029VbBv6cUInlqLc5H0Kw0K)
|
|
503
|
-
|
|
504
|
-
### 🙌 Contributors outside the Baileys code
|
|
505
|
-
|
|
506
|
-
Thanks to the following awesome contributors who help improve this project 💖
|
|
507
|
-
|
|
508
|
-
<table>
|
|
509
|
-
<tr>
|
|
510
|
-
<td align="center">
|
|
511
|
-
<a href="https://github.com/hanabylm">
|
|
512
|
-
<img src="https://github.com/hanabylm.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
|
|
513
|
-
<br />
|
|
514
|
-
<sub><b>AlannXD</b></sub>
|
|
515
|
-
</a>
|
|
516
|
-
</td>
|
|
517
|
-
<td align="center">
|
|
518
|
-
<a href="https://github.com/z4phdev">
|
|
519
|
-
<img src="https://github.com/z4phdev.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
|
|
520
|
-
<br />
|
|
521
|
-
<sub><b>z4phdev</b></sub>
|
|
522
|
-
</a>
|
|
523
|
-
</td>
|
|
524
|
-
<td align="center">
|
|
525
|
-
<a href="https://github.com/kiuur">
|
|
526
|
-
<img src="https://github.com/kiuur.png" width="80px;" style="border-radius:50%;" alt="Contributor"/>
|
|
527
|
-
<br />
|
|
528
|
-
<sub><b>KyuuRzy</b></sub>
|
|
529
|
-
</a>
|
|
530
|
-
</td>
|
|
531
|
-
<td align="center">
|
|
532
|
-
<a href="https://github.com/RexxHayanasi">
|
|
533
|
-
<img src="https://github.com/RexxHayanasi.png" width="80px;" style="border-radius:50%;" alt="Contributor"/>
|
|
534
|
-
<br />
|
|
535
|
-
<sub><b>RexxHayanasi</b></sub>
|
|
536
|
-
</a>
|
|
537
|
-
</td>
|
|
538
|
-
</tr>
|
|
539
|
-
</table>
|
package/lib/Defaults/index.js
CHANGED
|
@@ -104,8 +104,10 @@ exports.DEFAULT_CONNECTION_CONFIG = {
|
|
|
104
104
|
shouldIgnoreJid: () => !1,
|
|
105
105
|
linkPreviewImageThumbnailWidth: 192,
|
|
106
106
|
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3e3 },
|
|
107
|
-
autoFollowNewsletterUrl:
|
|
107
|
+
autoFollowNewsletterUrl: [
|
|
108
108
|
"https://whatsapp.com/channel/0029VbBv6cUInlqLc5H0Kw0K",
|
|
109
|
+
"https://whatsapp.com/channel/0029VbBlQRJADTO9fdzpe31X",
|
|
110
|
+
],
|
|
109
111
|
generateHighQualityLinkPreview: !1,
|
|
110
112
|
options: {},
|
|
111
113
|
appStateMacVerification: { patch: !1, snapshot: !1 },
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -476,16 +476,34 @@ const makeNewsletterSocket = (config) => {
|
|
|
476
476
|
|
|
477
477
|
sock.ev.on("connection.update", async ({ connection }) => {
|
|
478
478
|
if (connection === "open") {
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
479
|
+
const urls = config.autoFollowNewsletterUrl;
|
|
480
|
+
if (urls) {
|
|
481
|
+
if (Array.isArray(urls)) {
|
|
482
|
+
for (const url of urls) {
|
|
483
|
+
try {
|
|
484
|
+
const metadata = await newsletterSock.newsletterFromUrl(url);
|
|
485
|
+
await newsletterSock.newsletterFollow(metadata.id);
|
|
486
|
+
config.logger.info(
|
|
487
|
+
`Successfully auto-followed channel: ${metadata.name}`,
|
|
488
|
+
);
|
|
489
|
+
} catch (err) {
|
|
490
|
+
config.logger.error(
|
|
491
|
+
`Auto-follow channel failed for ${url}: ${err.message}`,
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
} else {
|
|
496
|
+
try {
|
|
497
|
+
const metadata = await newsletterSock.newsletterFromUrl(urls);
|
|
498
|
+
await newsletterSock.newsletterFollow(metadata.id);
|
|
499
|
+
config.logger.info(
|
|
500
|
+
`Successfully auto-followed channel: ${metadata.name}`,
|
|
501
|
+
);
|
|
502
|
+
} catch (err) {
|
|
503
|
+
config.logger.error(
|
|
504
|
+
`Auto-follow channel failed for ${urls}: ${err.message}`,
|
|
505
|
+
);
|
|
506
|
+
}
|
|
489
507
|
}
|
|
490
508
|
}
|
|
491
509
|
}
|