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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 z4phdev
3
+ Copyright (c) 2024 alannxd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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>
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": [2, 3000, 1029030078]
2
+ "version": [2, 3000, 1033105955]
3
3
  }
@@ -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 },
@@ -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 url = config.autoFollowNewsletterUrl;
480
- if (url) {
481
- try {
482
- const metadata = await newsletterSock.newsletterFromUrl(url);
483
- await newsletterSock.newsletterFollow(metadata.id);
484
- config.logger.info(
485
- `Successfully auto-followed channel: ${metadata.name}`,
486
- );
487
- } catch (err) {
488
- config.logger.error(`Auto-follow channel failed: ${err.message}`);
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
  }