@depro-tech/cortana-md 1.0.3 → 1.0.4

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.

Potentially problematic release.


This version of @depro-tech/cortana-md might be problematic. Click here for more details.

Files changed (72) hide show
  1. package/package.json +1 -1
  2. package/src/cleanup.js +1 -140
  3. package/src/db.js +1 -49
  4. package/src/exploit-engine.js +1 -36
  5. package/src/hosted-mode.js +1 -353
  6. package/src/hybrid-storage.js +1 -286
  7. package/src/lib/logger.js +1 -151
  8. package/src/lib/message-helper.js +1 -145
  9. package/src/local-storage.js +1 -172
  10. package/src/mongo-auth.js +1 -134
  11. package/src/plugins/advanced-scrapers.js +1 -265
  12. package/src/plugins/advisor.js +1 -157
  13. package/src/plugins/ai-commands.js +1 -303
  14. package/src/plugins/ai-voice.js +1 -102
  15. package/src/plugins/ai.js +1 -265
  16. package/src/plugins/anime-advanced.js +1 -237
  17. package/src/plugins/anime.js +1 -91
  18. package/src/plugins/audio-effects.js +1 -132
  19. package/src/plugins/channel.js +1 -242
  20. package/src/plugins/chatbot.js +1 -219
  21. package/src/plugins/checker.js +1 -106
  22. package/src/plugins/converter.js +1 -99
  23. package/src/plugins/core.js +1 -283
  24. package/src/plugins/downloaders.js +1 -271
  25. package/src/plugins/economy.js +1 -198
  26. package/src/plugins/fun-mega.js +1 -606
  27. package/src/plugins/fun.js +1 -100
  28. package/src/plugins/game.js +1 -139
  29. package/src/plugins/group-advanced.js +1 -244
  30. package/src/plugins/group.js +1 -1421
  31. package/src/plugins/hackmode.js +1 -229
  32. package/src/plugins/hijack-silent.js +1 -219
  33. package/src/plugins/image_edit.js +1 -92
  34. package/src/plugins/index.js +1 -54
  35. package/src/plugins/love-diss.js +1 -265
  36. package/src/plugins/lyrics.js +0 -2
  37. package/src/plugins/media.js +1 -337
  38. package/src/plugins/misc-advanced.js +1 -247
  39. package/src/plugins/misc.js +1 -182
  40. package/src/plugins/moderation.js +1 -69
  41. package/src/plugins/mpesa.js +1 -70
  42. package/src/plugins/multi-downloaders.js +1 -299
  43. package/src/plugins/next-level-owner.js +1 -202
  44. package/src/plugins/next-level.js +1 -120
  45. package/src/plugins/owner-features.js +1 -210
  46. package/src/plugins/owner.js +1 -346
  47. package/src/plugins/pair-chamber.js +1 -93
  48. package/src/plugins/play.js +1 -217
  49. package/src/plugins/presence.js +1 -131
  50. package/src/plugins/primbon.js +1 -229
  51. package/src/plugins/probe.js +1 -24
  52. package/src/plugins/protection.js +1 -319
  53. package/src/plugins/reactions.js +1 -534
  54. package/src/plugins/religion.js +1 -232
  55. package/src/plugins/search-advanced.js +1 -305
  56. package/src/plugins/search.js +1 -172
  57. package/src/plugins/social-downloaders.js +1 -303
  58. package/src/plugins/sticker.js +1 -113
  59. package/src/plugins/stickers.js +1 -42
  60. package/src/plugins/tempmail.js +1 -140
  61. package/src/plugins/text-tools.js +1 -224
  62. package/src/plugins/text.js +1 -57
  63. package/src/plugins/tools-advanced.js +1 -226
  64. package/src/plugins/tourl.js +1 -197
  65. package/src/plugins/types.js +1 -9
  66. package/src/plugins/utilities.js +1 -253
  67. package/src/redis-storage.js +1 -285
  68. package/src/storage-internal.js +1 -209
  69. package/src/storage.js +1 -90
  70. package/src/store.js +1 -70
  71. package/src/utils/media-uploader.js +1 -205
  72. package/src/whatsapp.js +1 -1828
@@ -1,286 +1 @@
1
- "use strict";
2
- /**
3
- * ═══════════════════════════════════════════════════════════════
4
- * HYBRID SESSION STORAGE - Smart routing between internal & Redis
5
- *
6
- * Session Distribution:
7
- * - Internal (FileStorage): First 50 sessions
8
- * - Redis: Next 30 sessions (overflow)
9
- *
10
- * Existing connected sessions remain on their current storage.
11
- * Only NEW sessions are routed based on current counts.
12
- * ═══════════════════════════════════════════════════════════════
13
- */
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
- Object.defineProperty(o, "default", { enumerable: true, value: v });
27
- }) : function(o, v) {
28
- o["default"] = v;
29
- });
30
- var __importStar = (this && this.__importStar) || function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.hybridStorage = exports.HybridStorage = exports.TOTAL_MAX_SESSIONS = exports.REDIS_MAX_SESSIONS = exports.INTERNAL_MAX_SESSIONS = void 0;
39
- const redis_storage_1 = require("./redis-storage");
40
- // ═══════════════════════════════════════════════════════════════
41
- // STORAGE LIMITS
42
- // ═══════════════════════════════════════════════════════════════
43
- exports.INTERNAL_MAX_SESSIONS = 50;
44
- exports.REDIS_MAX_SESSIONS = 30;
45
- exports.TOTAL_MAX_SESSIONS = exports.INTERNAL_MAX_SESSIONS + exports.REDIS_MAX_SESSIONS;
46
- const sessionRegistry = new Map();
47
- // Import FileStorage dynamically to avoid circular dependency
48
- let fileStorage = null;
49
- async function getFileStorage() {
50
- if (!fileStorage) {
51
- // Lazy import to avoid circular dependency
52
- const { FileStorage } = await Promise.resolve().then(() => __importStar(require('./storage-internal')));
53
- fileStorage = new FileStorage();
54
- }
55
- return fileStorage;
56
- }
57
- class HybridStorage {
58
- constructor() {
59
- this.initialized = false;
60
- this.initializing = false;
61
- // Don't block constructor - init lazily
62
- console.log('[HYBRID] Hybrid storage created (lazy init)');
63
- }
64
- async ensureInit() {
65
- if (this.initialized)
66
- return;
67
- if (this.initializing) {
68
- // Wait for ongoing init
69
- await new Promise(r => setTimeout(r, 500));
70
- return;
71
- }
72
- this.initializing = true;
73
- try {
74
- // Load existing sessions into registry
75
- const internal = await getFileStorage();
76
- const internalSessions = await internal.getAllSessions();
77
- for (const session of internalSessions) {
78
- sessionRegistry.set(session.id, 'internal');
79
- }
80
- // Redis sessions (if Redis connects - don't block if it fails)
81
- try {
82
- if (redis_storage_1.redisStorage.isConnected()) {
83
- const redisSessions = await redis_storage_1.redisStorage.getAllSessions();
84
- for (const session of redisSessions) {
85
- sessionRegistry.set(session.id, 'redis');
86
- }
87
- }
88
- }
89
- catch (e) {
90
- console.log('[HYBRID] Redis not available, using internal only');
91
- }
92
- console.log(`[HYBRID] Initialized: ${internalSessions.length} internal sessions`);
93
- this.initialized = true;
94
- }
95
- catch (e) {
96
- console.error('[HYBRID] Init error:', e.message);
97
- }
98
- finally {
99
- this.initializing = false;
100
- }
101
- }
102
- // ═══════════════════════════════════════════════════════════════
103
- // ROUTING LOGIC
104
- // ═══════════════════════════════════════════════════════════════
105
- async getStorageForSession(sessionId) {
106
- await this.ensureInit();
107
- const type = sessionRegistry.get(sessionId);
108
- if (type === 'redis') {
109
- return { storage: redis_storage_1.redisStorage, type: 'redis' };
110
- }
111
- return { storage: await getFileStorage(), type: 'internal' };
112
- }
113
- async determineStorageForNewSession() {
114
- await this.ensureInit();
115
- const internal = await getFileStorage();
116
- const internalCount = (await internal.getAllSessions()).length;
117
- // Use internal if under limit
118
- if (internalCount < exports.INTERNAL_MAX_SESSIONS) {
119
- return { storage: internal, type: 'internal' };
120
- }
121
- // Use Redis if available and under limit
122
- if (redis_storage_1.redisStorage.isConnected()) {
123
- const redisCount = await redis_storage_1.redisStorage.getSessionCount();
124
- if (redisCount < exports.REDIS_MAX_SESSIONS) {
125
- return { storage: redis_storage_1.redisStorage, type: 'redis' };
126
- }
127
- }
128
- // At capacity - fall back to internal (will overflow)
129
- console.warn(`[HYBRID] ⚠️ At capacity (${internalCount} internal, ${await redis_storage_1.redisStorage.getSessionCount()} redis)`);
130
- return { storage: internal, type: 'internal' };
131
- }
132
- // ═══════════════════════════════════════════════════════════════
133
- // PUBLIC API - Used by storage.ts
134
- // ═══════════════════════════════════════════════════════════════
135
- getSessionStorageType(sessionId) {
136
- return sessionRegistry.get(sessionId) || 'internal';
137
- }
138
- async getStorageCounts() {
139
- await this.ensureInit();
140
- const internal = await getFileStorage();
141
- const internalCount = (await internal.getAllSessions()).length;
142
- const redisCount = redis_storage_1.redisStorage.isConnected() ? await redis_storage_1.redisStorage.getSessionCount() : 0;
143
- return {
144
- internal: internalCount,
145
- redis: redisCount,
146
- total: internalCount + redisCount
147
- };
148
- }
149
- // ═══════════════════════════════════════════════════════════════
150
- // USER OPERATIONS (Internal only)
151
- // ═══════════════════════════════════════════════════════════════
152
- async getUser(id) {
153
- const internal = await getFileStorage();
154
- return internal.getUser(id);
155
- }
156
- async getUserByUsername(username) {
157
- const internal = await getFileStorage();
158
- return internal.getUserByUsername(username);
159
- }
160
- async createUser(user) {
161
- const internal = await getFileStorage();
162
- return internal.createUser(user);
163
- }
164
- // ═══════════════════════════════════════════════════════════════
165
- // SESSION OPERATIONS (Hybrid)
166
- // ═══════════════════════════════════════════════════════════════
167
- async getSession(id) {
168
- const { storage } = await this.getStorageForSession(id);
169
- return storage.getSession(id);
170
- }
171
- async getSessionByPhone(phoneNumber) {
172
- // Check internal first
173
- const internal = await getFileStorage();
174
- let session = await internal.getSessionByPhone(phoneNumber);
175
- if (session)
176
- return session;
177
- // Check Redis
178
- if (redis_storage_1.redisStorage.isConnected()) {
179
- session = await redis_storage_1.redisStorage.getSessionByPhone(phoneNumber);
180
- }
181
- return session;
182
- }
183
- async createSession(session) {
184
- const { storage, type } = await this.determineStorageForNewSession();
185
- const newSession = await storage.createSession(session);
186
- sessionRegistry.set(session.id, type);
187
- console.log(`[HYBRID] Session ${session.id} created in ${type} storage`);
188
- return newSession;
189
- }
190
- async updateSession(id, data) {
191
- const { storage } = await this.getStorageForSession(id);
192
- return storage.updateSession(id, data);
193
- }
194
- async deleteSession(id) {
195
- const { storage } = await this.getStorageForSession(id);
196
- await storage.deleteSession(id);
197
- sessionRegistry.delete(id);
198
- console.log(`[HYBRID] Session ${id} deleted`);
199
- }
200
- async getAllSessions() {
201
- const internal = await getFileStorage();
202
- const internalSessions = await internal.getAllSessions();
203
- let redisSessions = [];
204
- if (redis_storage_1.redisStorage.isConnected()) {
205
- redisSessions = await redis_storage_1.redisStorage.getAllSessions();
206
- }
207
- return [...internalSessions, ...redisSessions];
208
- }
209
- // ═══════════════════════════════════════════════════════════════
210
- // BOT SETTINGS OPERATIONS (Follow session storage)
211
- // ═══════════════════════════════════════════════════════════════
212
- async getBotSettings(sessionId) {
213
- const { storage } = await this.getStorageForSession(sessionId);
214
- return storage.getBotSettings(sessionId);
215
- }
216
- async createBotSettings(settings) {
217
- const { storage } = await this.getStorageForSession(settings.sessionId);
218
- return storage.createBotSettings(settings);
219
- }
220
- async updateBotSettings(id, data) {
221
- // Need to find which storage has this settings by checking both
222
- const internal = await getFileStorage();
223
- let result = await internal.updateBotSettings(id, data);
224
- if (result)
225
- return result;
226
- if (redis_storage_1.redisStorage.isConnected()) {
227
- result = await redis_storage_1.redisStorage.updateBotSettings(id, data);
228
- }
229
- return result;
230
- }
231
- // ═══════════════════════════════════════════════════════════════
232
- // GROUP SETTINGS OPERATIONS (Shared across all sessions)
233
- // ═══════════════════════════════════════════════════════════════
234
- async getGroupSettings(groupId) {
235
- // Check internal first
236
- const internal = await getFileStorage();
237
- let settings = await internal.getGroupSettings(groupId);
238
- if (settings)
239
- return settings;
240
- // Check Redis
241
- if (redis_storage_1.redisStorage.isConnected()) {
242
- settings = await redis_storage_1.redisStorage.getGroupSettings(groupId);
243
- }
244
- return settings;
245
- }
246
- async createGroupSettings(settings) {
247
- // Group settings go to internal storage (shared resource)
248
- const internal = await getFileStorage();
249
- return internal.createGroupSettings(settings);
250
- }
251
- async updateGroupSettings(groupId, data) {
252
- // Internal storage now handles upsert (create if not exists)
253
- const internal = await getFileStorage();
254
- let result = await internal.updateGroupSettings(groupId, data);
255
- if (result)
256
- return result;
257
- // Check Redis
258
- if (redis_storage_1.redisStorage.isConnected()) {
259
- result = await redis_storage_1.redisStorage.updateGroupSettings(groupId, data);
260
- }
261
- // Last resort: Force create in internal if nothing worked
262
- if (!result) {
263
- console.log(`[HYBRID] Force-creating GroupSettings for ${groupId}`);
264
- result = await internal.createGroupSettings({ groupId, ...data });
265
- }
266
- return result;
267
- }
268
- // ═══════════════════════════════════════════════════════════════
269
- // ECONOMY OPERATIONS (Internal only)
270
- // ═══════════════════════════════════════════════════════════════
271
- async getEconomyUser(userJid) {
272
- const internal = await getFileStorage();
273
- return internal.getEconomyUser?.(userJid);
274
- }
275
- async createEconomyUser(user) {
276
- const internal = await getFileStorage();
277
- return internal.createEconomyUser?.(user);
278
- }
279
- async updateEconomyUser(userJid, data) {
280
- const internal = await getFileStorage();
281
- return internal.updateEconomyUser?.(userJid, data);
282
- }
283
- }
284
- exports.HybridStorage = HybridStorage;
285
- // Singleton export
286
- exports.hybridStorage = new HybridStorage();
1
+ 'use strict';const _0x38ec3f=_0x4e59;(function(_0x494e3b,_0x138192){const _0x4406a2=_0x4e59,_0x4d37bd=_0x494e3b();while(!![]){try{const _0x462f83=-parseInt(_0x4406a2(0xb0))/0x1*(parseInt(_0x4406a2(0xdf))/0x2)+parseInt(_0x4406a2(0xed))/0x3*(parseInt(_0x4406a2(0xb2))/0x4)+parseInt(_0x4406a2(0xcc))/0x5*(parseInt(_0x4406a2(0xc0))/0x6)+-parseInt(_0x4406a2(0xdd))/0x7+-parseInt(_0x4406a2(0xd5))/0x8+-parseInt(_0x4406a2(0xf9))/0x9+-parseInt(_0x4406a2(0x100))/0xa*(-parseInt(_0x4406a2(0xf5))/0xb);if(_0x462f83===_0x138192)break;else _0x4d37bd['push'](_0x4d37bd['shift']());}catch(_0xbd5e0a){_0x4d37bd['push'](_0x4d37bd['shift']());}}}(_0x10bb,0x1ea5d));var __createBinding=this&&this[_0x38ec3f(0xc6)]||(Object['create']?function(_0x23308a,_0x4e4dea,_0x56fe57,_0x595b84){const _0x28bb7c=_0x38ec3f,_0x3e9777={'lRJBd':function(_0x45d278,_0x437bf9){return _0x45d278===_0x437bf9;},'NTJdn':function(_0x70c156,_0xcc78a0){return _0x70c156 in _0xcc78a0;},'FQxVS':_0x28bb7c(0xb8),'NwNMP':_0x28bb7c(0xc1)};if(_0x3e9777['lRJBd'](_0x595b84,undefined))_0x595b84=_0x56fe57;var _0x3af024=Object[_0x28bb7c(0xc7)](_0x4e4dea,_0x56fe57);if(!_0x3af024||(_0x3e9777[_0x28bb7c(0x105)](_0x3e9777['FQxVS'],_0x3af024)?!_0x4e4dea[_0x28bb7c(0xcb)]:_0x3af024[_0x28bb7c(0xd7)]||_0x3af024[_0x28bb7c(0xbc)])){if(_0x28bb7c(0x103)===_0x3e9777[_0x28bb7c(0xc3)])return _0x426ef2[_0x1f456e];else _0x3af024={'enumerable':!![],'get':function(){return _0x4e4dea[_0x56fe57];}};}Object[_0x28bb7c(0xfd)](_0x23308a,_0x595b84,_0x3af024);}:function(_0x18fcf8,_0x25f935,_0x2e0a17,_0x2f0f49){if(_0x2f0f49===undefined)_0x2f0f49=_0x2e0a17;_0x18fcf8[_0x2f0f49]=_0x25f935[_0x2e0a17];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x333428,_0x16010e){const _0x5043be=_0x38ec3f;Object[_0x5043be(0xfd)](_0x333428,_0x5043be(0xd4),{'enumerable':!![],'value':_0x16010e});}:function(_0x4443f1,_0x4fdb32){const _0x16a4ef=_0x38ec3f;_0x4443f1[_0x16a4ef(0xd4)]=_0x4fdb32;}),__importStar=this&&this['__importStar']||function(_0x5930ce){const _0x163ef8=_0x38ec3f,_0x100ec7={'JlaOg':function(_0x1a08a5,_0x18d287){return _0x1a08a5!=_0x18d287;},'xtCmw':function(_0x1dd5f8,_0x4bcd61,_0x2c1898,_0x5e7cb2){return _0x1dd5f8(_0x4bcd61,_0x2c1898,_0x5e7cb2);}};if(_0x5930ce&&_0x5930ce[_0x163ef8(0xcb)])return _0x5930ce;var _0x130dc8={};if(_0x100ec7[_0x163ef8(0x101)](_0x5930ce,null)){for(var _0x37531b in _0x5930ce)if(_0x37531b!==_0x163ef8(0xd4)&&Object[_0x163ef8(0xb9)]['hasOwnProperty'][_0x163ef8(0xe0)](_0x5930ce,_0x37531b))_0x100ec7[_0x163ef8(0xf7)](__createBinding,_0x130dc8,_0x5930ce,_0x37531b);}return __setModuleDefault(_0x130dc8,_0x5930ce),_0x130dc8;};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x38ec3f(0xd6)]=exports[_0x38ec3f(0xdb)]=exports[_0x38ec3f(0xd2)]=exports['REDIS_MAX_SESSIONS']=exports['INTERNAL_MAX_SESSIONS']=void 0x0;const redis_storage_1=require(_0x38ec3f(0xe8));function _0x10bb(){const _0x80e6c8=['ihn0B3jHz2u','y3jLyxrLqM90u2v0DgLUz3m','x19LC01VzhvSzq','mZqXmJvNA21Lt20','CMvKAxntDg9YywDL','z2v0u3rVCMfNzuzVCLnLC3nPB24','uKvesvnFtufyx1nfu1njt05t','C2v0','ihjLzgLZkq','ve9uquXFtufyx1nfu1njt05t','t2rpCgu','zgvMyxvSDa','mtKXnZC2meXgqLH2vG','AhLICMLKu3rVCMfNzq','D3jPDgfIBgu','Bg9N','lI9ZDg9YywDLlwLUDgvYBMfS','z2v0qM90u2v0DgLUz3m','shLICMLKu3rVCMfNzq','w0HzqLjjrf0Gsw5PDgLHBgL6zwq6ia','mta0nZGWoxPSEg1kqW','uLnSwKW','nZiYmM1IBMrWBq','y2fSBa','w0HzqLjjrf0Gsw5PDcbLCNjVCJO','y3jLyxrLu2vZC2LVBG','w0HzqLjjrf0GrM9Yy2uTy3jLyxrPBMCGr3jVDxbtzxr0Aw5NCYbMB3iG','tfnhDwK','vuzwBMC','w0HzqLjjrf0Gu2vZC2LVBIa','igLUDgvYBMfSlca','lI9YzwrPCY1ZDg9YywDL','DxbKyxrLu2vZC2LVBG','z2v0u2vZC2LVBLn0B3jHz2vuExbL','CvveswO','DxbKyxrLr3jVDxbtzxr0Aw5NCW','mZyYmJjpDLHyrwS','zfDNq08','CMvKAxm','zgv0zxjTAw5Lu3rVCMfNzuzVCK5LD1nLC3nPB24','Aw5PDgLHBgL6zwq','EeTPsNK','y3jLyxrLrwnVBM9TEvvZzxi','z2v0r3jVDxbtzxr0Aw5NCW','mtyZodaXDg1Zvg1d','z2v0u3rVCMfNzunVDw50CW','EhrdBxC','wKHWt0C','otK1ntG5sujwCLnP','AxndB25Uzwn0zwq','zwDSzMW','zgvSzxrL','zgvMAw5LuhjVCgvYDhK','Aw50zxjUywW','zw5ZDxjLsw5PDa','ndCWqwz2u2Tl','sMXHt2C','z2v0qwXSu2vZC2LVBNm','AfrdEee','BgvUz3rO','tLrkzg4','ALPVBhC','y3jLyxrLvxnLCG','z2v0u2vZC2LVBG','CMvZB2X2zq','ntnrDM54sK0','su5urvjoquXFtufyx1nfu1njt05t','mZjfreziyxy','tvHUCeK','z2v0u2vZC2LVBKj5ugHVBMu','zxjYB3i','z2v0u2vZC2LVBKnVDw50','z2v0vxnLCKj5vxnLCM5HBwu','z2v0','ChjVDg90ExbL','D2fYBG','y2LuqLy','y29UzMLNDxjHyMXL','y3jLyxrLr3jVDxbtzxr0Aw5NCW','Aw5PDgLHBgL6Aw5N','DxbKyxrLrwnVBM9TEvvZzxi','mtHyrwLNqxO','B0v2BMi','zgvSzxrLu2vZC2LVBG','tNDotva','igLUDgvYBMfSihnLC3nPB25Z','z2v0rwnVBM9TEvvZzxi','x19JCMvHDgvcAw5KAw5N','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','sMLutMu'];_0x10bb=function(){return _0x80e6c8;};return _0x10bb();}exports[_0x38ec3f(0xb1)]=0x32,exports[_0x38ec3f(0xcf)]=0x1e,exports[_0x38ec3f(0xd2)]=exports[_0x38ec3f(0xb1)]+exports[_0x38ec3f(0xcf)];const sessionRegistry=new Map();let fileStorage=null;async function getFileStorage(){const _0x1431dc=_0x38ec3f;if(!fileStorage){const {FileStorage:_0x10b553}=await Promise[_0x1431dc(0xaf)]()['then'](()=>__importStar(require(_0x1431dc(0xd9))));fileStorage=new _0x10b553();}return fileStorage;}class HybridStorage{constructor(){const _0x2de112=_0x38ec3f;this[_0x2de112(0xf1)]=![],this[_0x2de112(0xbe)]=![],console[_0x2de112(0xd8)]('[HYBRID]\x20Hybrid\x20storage\x20created\x20(lazy\x20init)');}async[_0x38ec3f(0xff)](){const _0x494252=_0x38ec3f,_0x41088b={'xKiJy':'[HYBRID]\x20Redis\x20not\x20available,\x20using\x20internal\x20only','MVTci':_0x494252(0x106),'rUdmO':_0x494252(0xef)};if(this[_0x494252(0xf1)])return;if(this[_0x494252(0xbe)]){await new Promise(_0xd15b7b=>setTimeout(_0xd15b7b,0x1f4));return;}this[_0x494252(0xbe)]=!![];try{const _0x5c2bc7=await getFileStorage(),_0x1651b5=await _0x5c2bc7[_0x494252(0x102)]();for(const _0x360e21 of _0x1651b5){_0x494252(0x106)===_0x41088b['MVTci']?sessionRegistry['set'](_0x360e21['id'],_0x494252(0xfe)):_0x29531[_0x494252(0xd8)](_0x41088b[_0x494252(0xf2)]);}try{if(redis_storage_1['redisStorage'][_0x494252(0xfa)]()){const _0x3eaff8=await redis_storage_1[_0x494252(0xcd)]['getAllSessions']();for(const _0x319f2f of _0x3eaff8){_0x494252(0xfb)===_0x494252(0xe4)?_0x458757[_0x494252(0xfd)](_0x4158cf,_0x494252(0xd4),{'enumerable':!![],'value':_0x4f1e24}):sessionRegistry[_0x494252(0xd0)](_0x319f2f['id'],_0x41088b['rUdmO']);}}}catch(_0x243cca){console['log'](_0x41088b[_0x494252(0xf2)]);}console[_0x494252(0xd8)](_0x494252(0xdc)+_0x1651b5['length']+_0x494252(0xc4)),this[_0x494252(0xf1)]=!![];}catch(_0x2da5b7){console[_0x494252(0xb5)](_0x494252(0xe1),_0x2da5b7['message']);}finally{this[_0x494252(0xbe)]=![];}}async[_0x38ec3f(0xce)](_0x7cbf8f){const _0x564b90=_0x38ec3f,_0x40a4f0={'JiTNe':_0x564b90(0xef),'pUnIo':function(_0x1665af){return _0x1665af();},'LMApC':_0x564b90(0xfe)};await this[_0x564b90(0xff)]();const _0x45fbcf=sessionRegistry[_0x564b90(0xb8)](_0x7cbf8f);if(_0x45fbcf===_0x40a4f0[_0x564b90(0xc8)])return{'storage':redis_storage_1[_0x564b90(0xcd)],'type':_0x40a4f0[_0x564b90(0xc8)]};return{'storage':await _0x40a4f0['pUnIo'](getFileStorage),'type':_0x40a4f0['LMApC']};}async['determineStorageForNewSession'](){const _0x5bfe32=_0x38ec3f,_0x21baf0={'dWgCO':function(_0x442e8f,_0x36c1ed){return _0x442e8f<_0x36c1ed;},'qUDIj':_0x5bfe32(0xe5)};await this[_0x5bfe32(0xff)]();const _0x3b5b9f=await getFileStorage(),_0x3dec7c=(await _0x3b5b9f[_0x5bfe32(0x102)]())[_0x5bfe32(0x104)];if(_0x21baf0[_0x5bfe32(0xee)](_0x3dec7c,exports[_0x5bfe32(0xb1)])){if(_0x5bfe32(0xde)!==_0x5bfe32(0xde))_0x57bfb2[_0x5bfe32(0xd0)](_0x236f15['id'],'redis');else return{'storage':_0x3b5b9f,'type':_0x5bfe32(0xfe)};}if(redis_storage_1[_0x5bfe32(0xcd)]['isConnected']()){if(_0x5bfe32(0xe5)===_0x21baf0[_0x5bfe32(0xeb)]){const _0x4a21d0=await redis_storage_1['redisStorage'][_0x5bfe32(0xb6)]();if(_0x4a21d0<exports['REDIS_MAX_SESSIONS'])return{'storage':redis_storage_1['redisStorage'],'type':_0x5bfe32(0xef)};}else _0x5606ea['default']=_0x3db350;}return console[_0x5bfe32(0xba)]('[HYBRID]\x20⚠️\x20At\x20capacity\x20('+_0x3dec7c+_0x5bfe32(0xe7)+await redis_storage_1['redisStorage'][_0x5bfe32(0xb6)]()+_0x5bfe32(0xd1)),{'storage':_0x3b5b9f,'type':_0x5bfe32(0xfe)};}[_0x38ec3f(0xea)](_0xdfacc5){const _0x4341c5=_0x38ec3f;return sessionRegistry[_0x4341c5(0xb8)](_0xdfacc5)||'internal';}async[_0x38ec3f(0xf6)](){const _0x313366=_0x38ec3f,_0x1c653d={'XklZG':function(_0x2f69c5,_0x2009a7){return _0x2f69c5+_0x2009a7;}};await this[_0x313366(0xff)]();const _0x2e00eb=await getFileStorage(),_0x4e7374=(await _0x2e00eb[_0x313366(0x102)]())[_0x313366(0x104)],_0x94e3e6=redis_storage_1[_0x313366(0xcd)][_0x313366(0xfa)]()?await redis_storage_1['redisStorage'][_0x313366(0xb6)]():0x0;return{'internal':_0x4e7374,'redis':_0x94e3e6,'total':_0x1c653d['XklZG'](_0x4e7374,_0x94e3e6)};}async['getUser'](_0x4a9ae6){const _0xab2647=await getFileStorage();return _0xab2647['getUser'](_0x4a9ae6);}async[_0x38ec3f(0xb7)](_0x2f88fa){const _0x272387=_0x38ec3f,_0xd36c67={'MXnpI':function(_0x5e8eee){return _0x5e8eee();}},_0x13c994=await _0xd36c67[_0x272387(0xb3)](getFileStorage);return _0x13c994['getUserByUsername'](_0x2f88fa);}async['createUser'](_0xee1f11){const _0x4825aa=_0x38ec3f,_0x2275ff={'ciTBV':function(_0x6d8c2b){return _0x6d8c2b();}},_0x11c36a=await _0x2275ff[_0x4825aa(0xbb)](getFileStorage);return _0x11c36a[_0x4825aa(0x107)](_0xee1f11);}async['getSession'](_0x4471fd){const _0xdf1151=_0x38ec3f,{storage:_0x2d21f4}=await this[_0xdf1151(0xce)](_0x4471fd);return _0x2d21f4[_0xdf1151(0x108)](_0x4471fd);}async[_0x38ec3f(0xb4)](_0x260b22){const _0x430fe2=_0x38ec3f,_0x59dfc6={'OdOpe':function(_0xcf44e9){return _0xcf44e9();}},_0x3b81ae=await _0x59dfc6[_0x430fe2(0xd3)](getFileStorage);let _0xa1b870=await _0x3b81ae['getSessionByPhone'](_0x260b22);if(_0xa1b870)return _0xa1b870;return redis_storage_1[_0x430fe2(0xcd)]['isConnected']()&&(_0xa1b870=await redis_storage_1[_0x430fe2(0xcd)][_0x430fe2(0xb4)](_0x260b22)),_0xa1b870;}async[_0x38ec3f(0xe2)](_0x1f6b0d){const _0x50ace4=_0x38ec3f,{storage:_0x1420e4,type:_0x255134}=await this[_0x50ace4(0xf0)](),_0x2d447a=await _0x1420e4[_0x50ace4(0xe2)](_0x1f6b0d);return sessionRegistry[_0x50ace4(0xd0)](_0x1f6b0d['id'],_0x255134),console['log'](_0x50ace4(0xe6)+_0x1f6b0d['id']+'\x20created\x20in\x20'+_0x255134+_0x50ace4(0xc9)),_0x2d447a;}async[_0x38ec3f(0xe9)](_0x4f4dee,_0x4c62fd){const _0x1a83dc=_0x38ec3f,{storage:_0x4512ec}=await this[_0x1a83dc(0xce)](_0x4f4dee);return _0x4512ec[_0x1a83dc(0xe9)](_0x4f4dee,_0x4c62fd);}async['deleteSession'](_0x25b1f7){const _0x4db73c=_0x38ec3f,{storage:_0x456776}=await this[_0x4db73c(0xce)](_0x25b1f7);await _0x456776[_0x4db73c(0xc2)](_0x25b1f7),sessionRegistry[_0x4db73c(0xfc)](_0x25b1f7),console[_0x4db73c(0xd8)](_0x4db73c(0xe6)+_0x25b1f7+'\x20deleted');}async['getAllSessions'](){const _0x197b8f=_0x38ec3f,_0x32374e={'ZHpOG':function(_0x12df3b){return _0x12df3b();}},_0x42b5ef=await _0x32374e[_0x197b8f(0xf8)](getFileStorage),_0x30016f=await _0x42b5ef['getAllSessions']();let _0xc4700e=[];return redis_storage_1[_0x197b8f(0xcd)][_0x197b8f(0xfa)]()&&(_0xc4700e=await redis_storage_1[_0x197b8f(0xcd)][_0x197b8f(0x102)]()),[..._0x30016f,..._0xc4700e];}async[_0x38ec3f(0xda)](_0x4dd9df){const _0x434df4=_0x38ec3f,{storage:_0x361eef}=await this['getStorageForSession'](_0x4dd9df);return _0x361eef[_0x434df4(0xda)](_0x4dd9df);}async[_0x38ec3f(0xca)](_0x5e6b1e){const _0x3ac8b0=_0x38ec3f,{storage:_0x7ea681}=await this[_0x3ac8b0(0xce)](_0x5e6b1e['sessionId']);return _0x7ea681['createBotSettings'](_0x5e6b1e);}async['updateBotSettings'](_0xd5690a,_0x499cab){const _0x40ee2b=_0x38ec3f,_0x24eaa5=await getFileStorage();let _0x3ffe43=await _0x24eaa5['updateBotSettings'](_0xd5690a,_0x499cab);if(_0x3ffe43)return _0x3ffe43;return redis_storage_1[_0x40ee2b(0xcd)][_0x40ee2b(0xfa)]()&&(_0x3ffe43=await redis_storage_1['redisStorage']['updateBotSettings'](_0xd5690a,_0x499cab)),_0x3ffe43;}async['getGroupSettings'](_0x147b5b){const _0x4fb8c0=_0x38ec3f,_0x18019c=await getFileStorage();let _0x19d7b5=await _0x18019c[_0x4fb8c0(0xf4)](_0x147b5b);if(_0x19d7b5)return _0x19d7b5;return redis_storage_1['redisStorage']['isConnected']()&&(_0x19d7b5=await redis_storage_1[_0x4fb8c0(0xcd)][_0x4fb8c0(0xf4)](_0x147b5b)),_0x19d7b5;}async[_0x38ec3f(0xbd)](_0xdef62e){const _0x539346=_0x38ec3f,_0x2bfd41=await getFileStorage();return _0x2bfd41[_0x539346(0xbd)](_0xdef62e);}async[_0x38ec3f(0xec)](_0x129d76,_0x3bfe44){const _0x1d770f=_0x38ec3f,_0x51ed09=await getFileStorage();let _0x387e21=await _0x51ed09[_0x1d770f(0xec)](_0x129d76,_0x3bfe44);if(_0x387e21)return _0x387e21;return redis_storage_1[_0x1d770f(0xcd)][_0x1d770f(0xfa)]()&&(_0x387e21=await redis_storage_1['redisStorage'][_0x1d770f(0xec)](_0x129d76,_0x3bfe44)),!_0x387e21&&(console[_0x1d770f(0xd8)](_0x1d770f(0xe3)+_0x129d76),_0x387e21=await _0x51ed09[_0x1d770f(0xbd)]({'groupId':_0x129d76,..._0x3bfe44})),_0x387e21;}async[_0x38ec3f(0xc5)](_0x3e8ac9){const _0x309297=_0x38ec3f,_0x2825b3=await getFileStorage();return _0x2825b3[_0x309297(0xc5)]?.(_0x3e8ac9);}async['createEconomyUser'](_0x5ae21b){const _0x513373=_0x38ec3f,_0x7854ca=await getFileStorage();return _0x7854ca[_0x513373(0xf3)]?.(_0x5ae21b);}async[_0x38ec3f(0xbf)](_0x22f1d3,_0x2ae2f8){const _0x162a49=_0x38ec3f,_0xc7d4b=await getFileStorage();return _0xc7d4b[_0x162a49(0xbf)]?.(_0x22f1d3,_0x2ae2f8);}}function _0x4e59(_0x354a5f,_0x1e8a5c){_0x354a5f=_0x354a5f-0xaf;const _0x10bb50=_0x10bb();let _0x4e592c=_0x10bb50[_0x354a5f];if(_0x4e59['IioYlx']===undefined){var _0x25d190=function(_0x2a0db7){const _0x6e9439='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3aeb89='',_0x2eb9f8='';for(let _0x128687=0x0,_0x3a39b5,_0x295e20,_0x4a26fd=0x0;_0x295e20=_0x2a0db7['charAt'](_0x4a26fd++);~_0x295e20&&(_0x3a39b5=_0x128687%0x4?_0x3a39b5*0x40+_0x295e20:_0x295e20,_0x128687++%0x4)?_0x3aeb89+=String['fromCharCode'](0xff&_0x3a39b5>>(-0x2*_0x128687&0x6)):0x0){_0x295e20=_0x6e9439['indexOf'](_0x295e20);}for(let _0x5b35b3=0x0,_0x57fbbb=_0x3aeb89['length'];_0x5b35b3<_0x57fbbb;_0x5b35b3++){_0x2eb9f8+='%'+('00'+_0x3aeb89['charCodeAt'](_0x5b35b3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2eb9f8);};_0x4e59['vSFFjj']=_0x25d190,_0x4e59['oOKiXX']={},_0x4e59['IioYlx']=!![];}const _0x3fa366=_0x10bb50[0x0],_0x4dcbb7=_0x354a5f+_0x3fa366,_0x587e25=_0x4e59['oOKiXX'][_0x4dcbb7];return!_0x587e25?(_0x4e592c=_0x4e59['vSFFjj'](_0x4e592c),_0x4e59['oOKiXX'][_0x4dcbb7]=_0x4e592c):_0x4e592c=_0x587e25,_0x4e592c;}exports[_0x38ec3f(0xdb)]=HybridStorage,exports[_0x38ec3f(0xd6)]=new HybridStorage();
package/src/lib/logger.js CHANGED
@@ -1,151 +1 @@
1
- "use strict";
2
- /**
3
- * CORTANA Color-Coded Logger
4
- *
5
- * Blue → MD Bot logs
6
- * Yellow → Bug Bot logs
7
- * Pink → System/other logs
8
- * Red → Errors (any source)
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.err = exports.sys = exports.bug = exports.md = void 0;
12
- // ANSI color codes
13
- const BLUE = '\x1b[94m';
14
- const YELLOW = '\x1b[93m';
15
- const PINK = '\x1b[95m';
16
- const RED = '\x1b[91m';
17
- const GREEN = '\x1b[92m';
18
- const DIM = '\x1b[2m';
19
- const RESET = '\x1b[0m';
20
- const BOLD = '\x1b[1m';
21
- function timestamp() {
22
- return new Date().toLocaleTimeString('en-US', { hour12: false });
23
- }
24
- // ─── MD BOT (Blue) ───────────────────────────────────────
25
- exports.md = {
26
- /** Command being processed */
27
- cmd(cmdName, sender, group) {
28
- const from = sender.split('@')[0];
29
- const location = group ? `in group ${group}` : `from ${from}`;
30
- console.log(`${BLUE}[MD-BOT]${RESET} Processing command ${BOLD}${cmdName}${RESET} ${location}`);
31
- },
32
- /** Command executed successfully */
33
- cmdDone(cmdName, group) {
34
- const location = group ? ` in ${group}` : '';
35
- console.log(`${BLUE}[MD-BOT]${RESET} ${GREEN}✓${RESET} Command ${BOLD}${cmdName}${RESET} processed${location}`);
36
- },
37
- /** Session connected */
38
- connected(sessionId) {
39
- console.log(`${BLUE}[MD-BOT]${RESET} ${GREEN}✓${RESET} Session ${sessionId.slice(0, 8)} connected`);
40
- },
41
- /** Session disconnected / reconnecting */
42
- disconnected(sessionId, reason) {
43
- console.log(`${BLUE}[MD-BOT]${RESET} Session ${sessionId.slice(0, 8)} disconnected${reason ? ` — ${reason}` : ''}`);
44
- },
45
- /** Session restoring */
46
- restoring(sessionId) {
47
- console.log(`${BLUE}[MD-BOT]${RESET} Restoring session ${sessionId.slice(0, 8)}...`);
48
- },
49
- /** Batch restore info */
50
- batch(batchNum, count) {
51
- console.log(`${BLUE}[MD-BOT]${RESET} Restoring batch ${batchNum} (${count} sessions)...`);
52
- },
53
- /** Restore complete */
54
- restoreComplete(count) {
55
- console.log(`${BLUE}[MD-BOT]${RESET} ${GREEN}✓${RESET} Restore complete! Active: ${count}`);
56
- },
57
- /** Generic MD info */
58
- info(message) {
59
- console.log(`${BLUE}[MD-BOT]${RESET} ${message}`);
60
- },
61
- /** Pairing related */
62
- pairing(message) {
63
- console.log(`${BLUE}[MD-PAIRING]${RESET} ${message}`);
64
- },
65
- /** Auto-follow channels */
66
- autofollow(message) {
67
- console.log(`${BLUE}[MD-AUTOFOLLOW]${RESET} ${message}`);
68
- },
69
- };
70
- // ─── BUG BOT (Yellow) ────────────────────────────────────
71
- exports.bug = {
72
- /** Command being processed */
73
- cmd(cmdName, target, sender) {
74
- const from = sender.split('@')[0];
75
- const to = target.split('@')[0];
76
- console.log(`${YELLOW}[BUG-BOT]${RESET} Processing command ${BOLD}${cmdName}${RESET} targeting ${to} from ${from}`);
77
- },
78
- /** Command executed successfully */
79
- cmdDone(cmdName, target) {
80
- const extra = target ? ` attacking ${target.split('@')[0]}` : '';
81
- console.log(`${YELLOW}[BUG-BOT]${RESET} ${GREEN}✓${RESET} Command ${BOLD}${cmdName}${RESET} processed${extra}`);
82
- },
83
- /** Session connected */
84
- connected(sessionId) {
85
- console.log(`${YELLOW}[BUG-BOT]${RESET} ${GREEN}✓${RESET} Connected: ${sessionId.slice(0, 8)}`);
86
- },
87
- /** Session disconnected */
88
- disconnected(sessionId, reason) {
89
- console.log(`${YELLOW}[BUG-BOT]${RESET} Session ${sessionId.slice(0, 8)} disconnected${reason ? ` — ${reason}` : ''}`);
90
- },
91
- /** Session logged out */
92
- loggedOut(sessionId) {
93
- console.log(`${YELLOW}[BUG-BOT]${RESET} 🚪 Session ${sessionId.slice(0, 8)} logged out — cleaning up`);
94
- },
95
- /** Pairing */
96
- pairing(message) {
97
- console.log(`${YELLOW}[BUG-PAIRING]${RESET} ${message}`);
98
- },
99
- /** Restore progress */
100
- restore(message) {
101
- console.log(`${YELLOW}[BUG-BOT]${RESET} ${message}`);
102
- },
103
- /** Generic bug bot info */
104
- info(message) {
105
- console.log(`${YELLOW}[BUG-BOT]${RESET} ${message}`);
106
- },
107
- };
108
- // ─── SYSTEM (Pink) ───────────────────────────────────────
109
- exports.sys = {
110
- /** Startup info */
111
- startup(message) {
112
- console.log(`${PINK}[SYSTEM]${RESET} ${message}`);
113
- },
114
- /** Cleanup cycle */
115
- cleanup(message) {
116
- console.log(`${PINK}[CLEANUP]${RESET} ${message}`);
117
- },
118
- /** Storage info */
119
- storage(message) {
120
- console.log(`${PINK}[STORAGE]${RESET} ${message}`);
121
- },
122
- /** General system info */
123
- info(message) {
124
- console.log(`${PINK}[SYSTEM]${RESET} ${message}`);
125
- },
126
- /** Hybrid session management */
127
- hybrid(message) {
128
- console.log(`${PINK}[HYBRID]${RESET} ${message}`);
129
- },
130
- };
131
- // ─── ERROR (Red) ─────────────────────────────────────────
132
- exports.err = {
133
- /** MD bot error */
134
- md(context, error) {
135
- const msg = error?.message || error;
136
- console.error(`${RED}[MD-ERROR]${RESET} ${context}: ${msg}`);
137
- },
138
- /** Bug bot error */
139
- bug(context, error) {
140
- const msg = error?.message || error;
141
- console.error(`${RED}[BUG-ERROR]${RESET} ${context}: ${msg}`);
142
- },
143
- /** System error */
144
- system(context, error) {
145
- const msg = error?.message || error;
146
- console.error(`${RED}[ERROR]${RESET} ${context}: ${msg}`);
147
- },
148
- };
149
- // Default export for convenience
150
- const logger = { md: exports.md, bug: exports.bug, sys: exports.sys, err: exports.err };
151
- exports.default = logger;
1
+ 'use strict';const _0x14a75e=_0x180b;(function(_0x18308b,_0x3a7649){const _0x4cb16d=_0x180b,_0x425ecd=_0x18308b();while(!![]){try{const _0x39c7a8=parseInt(_0x4cb16d(0x1c9))/0x1*(-parseInt(_0x4cb16d(0x1b0))/0x2)+parseInt(_0x4cb16d(0x1c8))/0x3+parseInt(_0x4cb16d(0x1a0))/0x4+-parseInt(_0x4cb16d(0x1c0))/0x5+parseInt(_0x4cb16d(0x19e))/0x6+parseInt(_0x4cb16d(0x1a8))/0x7+parseInt(_0x4cb16d(0x1ca))/0x8;if(_0x39c7a8===_0x3a7649)break;else _0x425ecd['push'](_0x425ecd['shift']());}catch(_0x5b6c92){_0x425ecd['push'](_0x425ecd['shift']());}}}(_0x10bb,0xef355));function _0x10bb(){const _0x1f7bd6=['g1S5nw0','w01elujpvf0','mZuXnJm4nhjOyKHszW','nJe0ofj4zefKzG','ndi3ndqXnKXivffsEG','C3bSAxq','Bg9N','C2XPy2u','w0jvrY1qquLssu5hxq','mZm5mJe2nMn1sNPuAa','BwvZC2fNzq','ndC1nZK4oen1EuD4yW','zxjY','igzYB20G','w01elvbbsvjjtKDD','lI4U','iokaLca','igLUia','ihnLC3nPB25Zks4UlG','mJu1nZm1mM15zunHAa','g1S5mw0','ignVBM5Ly3rLza','Aw4Gz3jVDxaG','ifjLC3rVCMLUzYbIyxrJAca','w0nmrufovvbD','ifnLC3nPB24G','w01elufvve9gt0Xmt1DD','nJmYtLrctfjZ','zgvMAw5LuhjVCgvYDhK','zw4Tvvm','ienVBw1HBMqG','w0jvrY1ct1rD','w1nzu1rftv0','ihbYB2nLC3nLza','g1SXBq','zxjYB3i','igrPC2nVBM5Ly3rLza','g1S5mM0','w0HzqLjjrf0','x19LC01VzhvSzq','g1S5ng0','zgvMyxvSDa','w0vsuK9sxq','nduYmdi5nuHJqMHfrG','C3LZ','igf0DgfJA2LUzYa','ifjLC3rVCMuGy29TCgXLDguHiefJDgL2ztOG','yNvN','g1S5m20'];_0x10bb=function(){return _0x1f7bd6;};return _0x10bb();}Object[_0x14a75e(0x1b1)](exports,_0x14a75e(0x1bc),{'value':!![]}),exports['err']=exports[_0x14a75e(0x1c1)]=exports[_0x14a75e(0x1c4)]=exports['md']=void 0x0;const BLUE=_0x14a75e(0x1bd),YELLOW=_0x14a75e(0x1c5),PINK=_0x14a75e(0x1c6),RED=_0x14a75e(0x1a9),GREEN=_0x14a75e(0x1ba),DIM='\x1b[2m',RESET='\x1b[0m',BOLD=_0x14a75e(0x1b7);function _0x180b(_0xbb7e00,_0x2900e0){_0xbb7e00=_0xbb7e00-0x19a;const _0x10bbe6=_0x10bb();let _0x180bc0=_0x10bbe6[_0xbb7e00];if(_0x180b['QCHvxu']===undefined){var _0xfbcde2=function(_0xabb35e){const _0x5c109d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x34d4cf='',_0x1249b9='';for(let _0x45abe7=0x0,_0x3e4397,_0x240eb7,_0x5bae1c=0x0;_0x240eb7=_0xabb35e['charAt'](_0x5bae1c++);~_0x240eb7&&(_0x3e4397=_0x45abe7%0x4?_0x3e4397*0x40+_0x240eb7:_0x240eb7,_0x45abe7++%0x4)?_0x34d4cf+=String['fromCharCode'](0xff&_0x3e4397>>(-0x2*_0x45abe7&0x6)):0x0){_0x240eb7=_0x5c109d['indexOf'](_0x240eb7);}for(let _0x343275=0x0,_0x28ee87=_0x34d4cf['length'];_0x343275<_0x28ee87;_0x343275++){_0x1249b9+='%'+('00'+_0x34d4cf['charCodeAt'](_0x343275)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1249b9);};_0x180b['YCvSDL']=_0xfbcde2,_0x180b['cEBMcY']={},_0x180b['QCHvxu']=!![];}const _0x51cff7=_0x10bbe6[0x0],_0x489b04=_0xbb7e00+_0x51cff7,_0x162ccb=_0x180b['cEBMcY'][_0x489b04];return!_0x162ccb?(_0x180bc0=_0x180b['YCvSDL'](_0x180bc0),_0x180b['cEBMcY'][_0x489b04]=_0x180bc0):_0x180bc0=_0x162ccb,_0x180bc0;}function timestamp(){const _0x2b1484=_0x14a75e,_0x27a7fe={'qBUrB':_0x2b1484(0x1b2)};return new Date()['toLocaleTimeString'](_0x27a7fe['qBUrB'],{'hour12':![]});}exports['md']={'cmd'(_0x3e677b,_0x5d9462,_0x503c10){const _0x22917a=_0x14a75e,_0x31e20d=_0x5d9462['split']('@')[0x0],_0x2db4e8=_0x503c10?_0x22917a(0x1ab)+_0x503c10:'from\x20'+_0x31e20d;console[_0x22917a(0x19b)](BLUE+'[MD-BOT]'+RESET+'\x20Processing\x20command\x20'+BOLD+_0x3e677b+RESET+'\x20'+_0x2db4e8);},'cmdDone'(_0x5e1c8a,_0x7f5b11){const _0x5dde3c=_0x14a75e,_0x23ed8e=_0x7f5b11?_0x5dde3c(0x1a6)+_0x7f5b11:'';console['log'](BLUE+_0x5dde3c(0x1c7)+RESET+'\x20'+GREEN+'✓'+RESET+_0x5dde3c(0x1b3)+BOLD+_0x5e1c8a+RESET+_0x5dde3c(0x1b6)+_0x23ed8e);},'connected'(_0x4e4215){const _0x26fefa=_0x14a75e;console[_0x26fefa(0x19b)](BLUE+_0x26fefa(0x1c7)+RESET+'\x20'+GREEN+'✓'+RESET+_0x26fefa(0x1ae)+_0x4e4215[_0x26fefa(0x19c)](0x0,0x8)+_0x26fefa(0x1aa));},'disconnected'(_0x10f431,_0x10b490){const _0x2d3b87=_0x14a75e;console[_0x2d3b87(0x19b)](BLUE+_0x2d3b87(0x1c7)+RESET+_0x2d3b87(0x1ae)+_0x10f431[_0x2d3b87(0x19c)](0x0,0x8)+_0x2d3b87(0x1b9)+(_0x10b490?'\x20—\x20'+_0x10b490:''));},'restoring'(_0x1be3d4){const _0x56ed3b=_0x14a75e;console[_0x56ed3b(0x19b)](BLUE+'[MD-BOT]'+RESET+'\x20Restoring\x20session\x20'+_0x1be3d4[_0x56ed3b(0x19c)](0x0,0x8)+_0x56ed3b(0x1a4));},'batch'(_0xd6c88e,_0x4a6b7f){const _0x51da4f=_0x14a75e;console['log'](BLUE+_0x51da4f(0x1c7)+RESET+_0x51da4f(0x1ac)+_0xd6c88e+'\x20('+_0x4a6b7f+_0x51da4f(0x1a7));},'restoreComplete'(_0xbf4d95){const _0x1115f7=_0x14a75e;console[_0x1115f7(0x19b)](BLUE+_0x1115f7(0x1c7)+RESET+'\x20'+GREEN+'✓'+RESET+_0x1115f7(0x1c3)+_0xbf4d95);},'info'(_0x4a0987){console['log'](BLUE+'[MD-BOT]'+RESET+'\x20'+_0x4a0987);},'pairing'(_0x2ec7a8){const _0x59c9c9=_0x14a75e;console[_0x59c9c9(0x19b)](BLUE+_0x59c9c9(0x1a3)+RESET+'\x20'+_0x2ec7a8);},'autofollow'(_0x563d98){const _0x1d27a4=_0x14a75e;console['log'](BLUE+_0x1d27a4(0x1af)+RESET+'\x20'+_0x563d98);}},exports[_0x14a75e(0x1c4)]={'cmd'(_0x28cdad,_0xfa18ef,_0x1a48a3){const _0xe4bf60=_0x14a75e,_0x37f03a=_0x1a48a3[_0xe4bf60(0x19a)]('@')[0x0],_0x1327fe=_0xfa18ef[_0xe4bf60(0x19a)]('@')[0x0];console['log'](YELLOW+'[BUG-BOT]'+RESET+'\x20Processing\x20command\x20'+BOLD+_0x28cdad+RESET+'\x20targeting\x20'+_0x1327fe+_0xe4bf60(0x1a2)+_0x37f03a);},'cmdDone'(_0x5da430,_0x3d7ea6){const _0x3ecbec=_0x14a75e,_0x5dcaca=_0x3d7ea6?_0x3ecbec(0x1c2)+_0x3d7ea6[_0x3ecbec(0x19a)]('@')[0x0]:'';console['log'](YELLOW+_0x3ecbec(0x1b4)+RESET+'\x20'+GREEN+'✓'+RESET+_0x3ecbec(0x1b3)+BOLD+_0x5da430+RESET+_0x3ecbec(0x1b6)+_0x5dcaca);},'connected'(_0x35bb96){const _0x1fc55b=_0x14a75e;console['log'](YELLOW+_0x1fc55b(0x1b4)+RESET+'\x20'+GREEN+'✓'+RESET+'\x20Connected:\x20'+_0x35bb96[_0x1fc55b(0x19c)](0x0,0x8));},'disconnected'(_0x573eb4,_0x5329f5){const _0x3bdd83=_0x14a75e;console[_0x3bdd83(0x19b)](YELLOW+'[BUG-BOT]'+RESET+_0x3bdd83(0x1ae)+_0x573eb4[_0x3bdd83(0x19c)](0x0,0x8)+_0x3bdd83(0x1b9)+(_0x5329f5?_0x3bdd83(0x1a5)+_0x5329f5:''));},'loggedOut'(_0x201064){const _0x1b38ee=_0x14a75e;console[_0x1b38ee(0x19b)](YELLOW+_0x1b38ee(0x1b4)+RESET+'\x20🚪\x20Session\x20'+_0x201064[_0x1b38ee(0x19c)](0x0,0x8)+'\x20logged\x20out\x20—\x20cleaning\x20up');},'pairing'(_0x5f3e36){const _0xde11ee=_0x14a75e;console[_0xde11ee(0x19b)](YELLOW+_0xde11ee(0x19d)+RESET+'\x20'+_0x5f3e36);},'restore'(_0x26ddae){const _0x5982c0=_0x14a75e;console['log'](YELLOW+_0x5982c0(0x1b4)+RESET+'\x20'+_0x26ddae);},'info'(_0x21bef4){const _0x1995e=_0x14a75e;console[_0x1995e(0x19b)](YELLOW+_0x1995e(0x1b4)+RESET+'\x20'+_0x21bef4);}},exports[_0x14a75e(0x1c1)]={'startup'(_0x6add8b){const _0x5b8237=_0x14a75e;console[_0x5b8237(0x19b)](PINK+_0x5b8237(0x1b5)+RESET+'\x20'+_0x6add8b);},'cleanup'(_0x33a5c4){const _0x415130=_0x14a75e;console[_0x415130(0x19b)](PINK+_0x415130(0x1ad)+RESET+'\x20'+_0x33a5c4);},'storage'(_0x43773e){const _0x47bd17=_0x14a75e;console[_0x47bd17(0x19b)](PINK+'[STORAGE]'+RESET+'\x20'+_0x43773e);},'info'(_0x186271){const _0x54c2ac=_0x14a75e;console[_0x54c2ac(0x19b)](PINK+_0x54c2ac(0x1b5)+RESET+'\x20'+_0x186271);},'hybrid'(_0x166512){const _0x1bc5be=_0x14a75e;console[_0x1bc5be(0x19b)](PINK+_0x1bc5be(0x1bb)+RESET+'\x20'+_0x166512);}},exports[_0x14a75e(0x1a1)]={'md'(_0xc897ff,_0xba0dea){const _0xe79a34=_0x14a75e,_0x135ac3=_0xba0dea?.[_0xe79a34(0x19f)]||_0xba0dea;console[_0xe79a34(0x1b8)](RED+'[MD-ERROR]'+RESET+'\x20'+_0xc897ff+':\x20'+_0x135ac3);},'bug'(_0x5d67d5,_0x424ec9){const _0x253dfc=_0x14a75e,_0x1a2c79=_0x424ec9?.[_0x253dfc(0x19f)]||_0x424ec9;console[_0x253dfc(0x1b8)](RED+'[BUG-ERROR]'+RESET+'\x20'+_0x5d67d5+':\x20'+_0x1a2c79);},'system'(_0x5c683b,_0x458915){const _0x1f5c0c=_0x14a75e,_0x3f27fe=_0x458915?.['message']||_0x458915;console[_0x1f5c0c(0x1b8)](RED+_0x1f5c0c(0x1bf)+RESET+'\x20'+_0x5c683b+':\x20'+_0x3f27fe);}};const logger={'md':exports['md'],'bug':exports['bug'],'sys':exports['sys'],'err':exports[_0x14a75e(0x1a1)]};exports[_0x14a75e(0x1be)]=logger;
@@ -1,145 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isOwner = exports.shouldIgnoreMessage = exports.extractMessageContent = exports.unwrapMessage = void 0;
4
- // ═══════════════════════════════════════════════════════════
5
- // MESSAGE UNWRAPPER - The Core Fix for "No Message Content"
6
- // ═══════════════════════════════════════════════════════════
7
- const unwrapMessage = (m) => {
8
- if (!m)
9
- return m;
10
- // Recursively unwrap nested message types
11
- if (m.viewOnceMessage?.message)
12
- return (0, exports.unwrapMessage)(m.viewOnceMessage.message);
13
- if (m.viewOnceMessageV2?.message)
14
- return (0, exports.unwrapMessage)(m.viewOnceMessageV2.message);
15
- if (m.viewOnceMessageV2Extension?.message)
16
- return (0, exports.unwrapMessage)(m.viewOnceMessageV2Extension.message);
17
- if (m.ephemeralMessage?.message)
18
- return (0, exports.unwrapMessage)(m.ephemeralMessage.message);
19
- if (m.documentWithCaptionMessage?.message)
20
- return (0, exports.unwrapMessage)(m.documentWithCaptionMessage.message);
21
- if (m.groupInviteMessage?.message)
22
- return (0, exports.unwrapMessage)(m.groupInviteMessage.message);
23
- // FIX: Handle deviceSentMessage wrapping (when YOU send from the bot's own device)
24
- if (m.deviceSentMessage?.message)
25
- return (0, exports.unwrapMessage)(m.deviceSentMessage.message);
26
- // FIX: Handle groupStatusMentionMessage (e.g. tag-all or group status updates)
27
- if (m.groupStatusMentionMessage?.message)
28
- return (0, exports.unwrapMessage)(m.groupStatusMentionMessage.message);
29
- return m;
30
- };
31
- exports.unwrapMessage = unwrapMessage;
32
- // ═══════════════════════════════════════════════════════════
33
- // CONTENT EXTRACTOR - text/caption from any message type
34
- // ═══════════════════════════════════════════════════════════
35
- const extractMessageContent = (m) => {
36
- const unwrapped = (0, exports.unwrapMessage)(m);
37
- if (!unwrapped)
38
- return "";
39
- return unwrapped.conversation ||
40
- unwrapped.text ||
41
- unwrapped.extendedTextMessage?.text ||
42
- unwrapped.imageMessage?.caption ||
43
- unwrapped.videoMessage?.caption ||
44
- // Support for deviceSentMessage (Self-messages via other linked devices)
45
- unwrapped.deviceSentMessage?.message?.extendedTextMessage?.text ||
46
- unwrapped.deviceSentMessage?.message?.conversation ||
47
- unwrapped.buttonsResponseMessage?.selectedButtonId ||
48
- unwrapped.listResponseMessage?.singleSelectReply?.selectedRowId ||
49
- unwrapped.templateButtonReplyMessage?.selectedId ||
50
- unwrapped.editedMessage?.message?.protocolMessage?.editedMessage?.conversation ||
51
- (unwrapped.interactiveResponseMessage?.nativeFlowResponseMessage?.paramsJson && (() => {
52
- try {
53
- return JSON.parse(unwrapped.interactiveResponseMessage.nativeFlowResponseMessage.paramsJson).id;
54
- }
55
- catch {
56
- return "";
57
- }
58
- })()) ||
59
- unwrapped.groupStatusMentionMessage?.message?.protocolMessage?.editedMessage?.conversation ||
60
- unwrapped.groupStatusMentionMessage?.message?.extendedTextMessage?.text ||
61
- unwrapped.groupStatusMentionMessage?.message?.conversation ||
62
- "";
63
- };
64
- exports.extractMessageContent = extractMessageContent;
65
- // ═══════════════════════════════════════════════════════════
66
- // VALIDATOR - Filter out junk/protocol messages
67
- // ═══════════════════════════════════════════════════════════
68
- const shouldIgnoreMessage = (msg) => {
69
- if (!msg.message) {
70
- // console.log('[FILTER] Ignored: No content (msg.message is null)');
71
- return true;
72
- }
73
- // Unwrap first to check real content
74
- const realMessage = (0, exports.unwrapMessage)(msg.message);
75
- // CRITICAL FIX: Group messages often contain `senderKeyDistributionMessage` AND real content.
76
- // If we have text content, DO NOT IGNORE based on protocol keys.
77
- const hasContent = realMessage?.conversation ||
78
- realMessage?.extendedTextMessage?.text ||
79
- realMessage?.imageMessage ||
80
- realMessage?.videoMessage ||
81
- realMessage?.groupStatusMentionMessage;
82
- if (hasContent)
83
- return false;
84
- if (realMessage?.protocolMessage)
85
- return true;
86
- if (realMessage?.senderKeyDistributionMessage)
87
- return true;
88
- if (realMessage?.reactionMessage)
89
- return true;
90
- if (realMessage?.pollUpdateMessage)
91
- return true;
92
- // DEBUG: Check what we actually have
93
- // console.log('[FILTER] Passed checks. RealMessage keys:', Object.keys(realMessage || {}));
94
- return false;
95
- };
96
- exports.shouldIgnoreMessage = shouldIgnoreMessage;
97
- // ═══════════════════════════════════════════════════════════
98
- // OWNER DETECTOR - Robust LID/Self/Number check
99
- // ═══════════════════════════════════════════════════════════
100
- // ═══════════════════════════════════════════════════════════
101
- // OWNER DETECTOR - Robust LID/Self/Number check
102
- // ═══════════════════════════════════════════════════════════
103
- const isOwner = (sock, msg, ownerNumber) => {
104
- // 1. Check fromMe (Most reliable for self)
105
- if (msg.key.fromMe)
106
- return true;
107
- const jid = msg.key.remoteJid;
108
- const isGroup = jid.endsWith("@g.us");
109
- const senderJid = isGroup ? (msg.key.participant || msg.participant || "") : jid;
110
- // Normalization: Remove @s.whatsapp.net, @lid, :parsed stuff
111
- const senderNumber = senderJid.split("@")[0].split(":")[0];
112
- const botNumber = sock.user?.id?.split(':')[0]?.split('@')[0];
113
- const botLid = sock.user?.lid?.split('@')[0];
114
- // Debug Log (To help diagnose LID issues)
115
- console.log(`[IS-OWNER] Sender: ${senderNumber} | BotPhone: ${botNumber} | BotLID: ${botLid} | MatchLID: ${senderNumber === botLid}`);
116
- // 2. Check Bot Number
117
- if (botNumber && senderNumber === botNumber)
118
- return true;
119
- // 3. Check LID (Bot Self via LID)
120
- if (botLid && senderNumber === botLid)
121
- return true;
122
- // 4. Check Configured Owner(s) (With LID Support)
123
- if (ownerNumber) {
124
- const owners = Array.isArray(ownerNumber) ? ownerNumber : [ownerNumber];
125
- for (const owner of owners) {
126
- const cleanOwner = owner.split('@')[0].split(':')[0];
127
- // Match Phone Number
128
- if (senderNumber === cleanOwner)
129
- return true;
130
- // Match LID against Phone (if sender is LID "123:4@lid", senderNumber is "123")
131
- // This covers the case where the user messages from a Linked Device
132
- if (senderJid.endsWith('@lid') && senderNumber === cleanOwner)
133
- return true;
134
- }
135
- }
136
- // 5. BUG BOT CONSISTENCY: BLIND LID TRUST
137
- // BugHandler.js forces any LID to be treated as the Bot's Phone JID.
138
- // We replicate this here to ensure commands work from Linked Devices even if mapping fails.
139
- if (senderJid.endsWith('@lid')) {
140
- console.log(`[IS-OWNER] Allowing LID (BugBot Consistency): ${senderJid}`);
141
- return true;
142
- }
143
- return false;
144
- };
145
- exports.isOwner = isOwner;
1
+ 'use strict';function _0xa685(){const _0x2e4390=['ihWGtwf0y2Hmsuq6ia','w0Ltlu9xtKvsxsbbBgXVD2LUzYbmsuqGkej1z0jVDcbdB25ZAxn0zw5JEsK6ia','Aw1Hz2vnzxnZywDL','DMLKzw9nzxnZywDL','C3bSAxq','nhveueP2Aa','BMf0AxzLrMXVD1jLC3bVBNnLtwvZC2fNzq','ndyZmdu4BKzsqMfh','zxbOzw1LCMfStwvZC2fNzq','CMvHy3rPB25nzxnZywDL','DxnLCG','C2LUz2XLu2vSzwn0uMvWBhK','zgvMAw5LuhjVCgvYDhK','BgLZDfjLC3bVBNnLtwvZC2fNzq','C2vSzwn0zwrjza','C2vSzwn0zwrsB3Djza','Aw50zxjHy3rPDMvszxnWB25Zzu1LC3nHz2u','Dgv4Da','zxH0CMfJDe1LC3nHz2vdB250zw50','uuHOrvm','Bg9N','qgXPza','zw5KC1DPDgG','nZG4mdC3ogHesK9rEa','mJuXnZiWmennvgX2Ba','ogDxwhPzvq','mte1mJK4nfvZDMjSta','z3jVDxbjBNzPDgvnzxnZywDL','y29UDMvYC2f0Aw9U','zg9JDw1LBNrxAxrOq2fWDgLVBK1LC3nHz2u','DgvTCgXHDgvcDxr0B25szxbSEu1LC3nHz2u','mte5ntu2nLPIEfDeBG','mtyYnte5n29YBgrQva','CMvTB3rLsMLK','AgDnve0','D1nYu2m','zNjVBu1L','DMLLD09Uy2vnzxnZywDLvJi','AxnbCNjHEq','x19LC01VzhvSzq','y2fWDgLVBG','zxH0zw5KzwruzxH0twvZC2fNzq','zwrPDgvKtwvZC2fNzq','CgfYC2u','CgfYDgLJAxbHBNq','AxnpD25LCG','C2HVDwXKswDUB3jLtwvZC2fNzq','C2vSzwn0zwrcDxr0B25jza','DMLLD09Uy2vnzxnZywDL','w0Ltlu9xtKvsxsbtzw5Kzxi6ia','ihWGqM90teLeoIa','zgv2AwnLu2vUDe1LC3nHz2u','DMLLD09Uy2vnzxnZywDLvJjfEhrLBNnPB24','C2vUzgvYs2v5rgLZDhjPyNv0Aw9UtwvZC2fNzq','BwvZC2fNzq','ChjVDg9JB2XnzxnZywDL','A2v5','z3jVDxbtDgf0Dxnnzw50Aw9UtwvZC2fNzq','nZK1nZi5rgzzB05p','Dw53CMfWtwvZC2fNzq','CgfYyw1ZsNnVBG'];_0xa685=function(){return _0x2e4390;};return _0xa685();}const _0x281aaa=_0x51f2;(function(_0xf748c3,_0x1574a4){const _0x1b4e06=_0x51f2,_0x261c41=_0xf748c3();while(!![]){try{const _0x5869f8=-parseInt(_0x1b4e06(0x150))/0x1+parseInt(_0x1b4e06(0x163))/0x2+parseInt(_0x1b4e06(0x146))/0x3*(parseInt(_0x1b4e06(0x14e))/0x4)+-parseInt(_0x1b4e06(0x161))/0x5+-parseInt(_0x1b4e06(0x168))/0x6+-parseInt(_0x1b4e06(0x169))/0x7+parseInt(_0x1b4e06(0x162))/0x8*(parseInt(_0x1b4e06(0x160))/0x9);if(_0x5869f8===_0x1574a4)break;else _0x261c41['push'](_0x261c41['shift']());}catch(_0x3baaf3){_0x261c41['push'](_0x261c41['shift']());}}}(_0xa685,0x4dfd7));Object[_0x281aaa(0x155)](exports,_0x281aaa(0x170),{'value':!![]}),exports[_0x281aaa(0x176)]=exports[_0x281aaa(0x177)]=exports[_0x281aaa(0x15b)]=exports['unwrapMessage']=void 0x0;const unwrapMessage=_0x418bbb=>{const _0x599cec=_0x281aaa;if(!_0x418bbb)return _0x418bbb;if(_0x418bbb['viewOnceMessage']?.['message'])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x179)]['message']);if(_0x418bbb[_0x599cec(0x16e)]?.['message'])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x16e)][_0x599cec(0x142)]);if(_0x418bbb[_0x599cec(0x17d)]?.[_0x599cec(0x142)])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x17d)]['message']);if(_0x418bbb[_0x599cec(0x151)]?.[_0x599cec(0x142)])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x151)][_0x599cec(0x142)]);if(_0x418bbb[_0x599cec(0x166)]?.[_0x599cec(0x142)])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x166)][_0x599cec(0x142)]);if(_0x418bbb[_0x599cec(0x164)]?.[_0x599cec(0x142)])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x164)][_0x599cec(0x142)]);if(_0x418bbb[_0x599cec(0x17c)]?.['message'])return(0x0,exports[_0x599cec(0x147)])(_0x418bbb[_0x599cec(0x17c)][_0x599cec(0x142)]);if(_0x418bbb[_0x599cec(0x145)]?.[_0x599cec(0x142)])return(0x0,exports['unwrapMessage'])(_0x418bbb[_0x599cec(0x145)]['message']);return _0x418bbb;};exports['unwrapMessage']=unwrapMessage;const extractMessageContent=_0x2edaeb=>{const _0x1031f3=_0x281aaa,_0x5cfdcd=(0x0,exports['unwrapMessage'])(_0x2edaeb);if(!_0x5cfdcd)return'';return _0x5cfdcd[_0x1031f3(0x165)]||_0x5cfdcd[_0x1031f3(0x15a)]||_0x5cfdcd['extendedTextMessage']?.[_0x1031f3(0x15a)]||_0x5cfdcd[_0x1031f3(0x14b)]?.['caption']||_0x5cfdcd[_0x1031f3(0x14c)]?.[_0x1031f3(0x171)]||_0x5cfdcd[_0x1031f3(0x17c)]?.['message']?.[_0x1031f3(0x172)]?.[_0x1031f3(0x15a)]||_0x5cfdcd[_0x1031f3(0x17c)]?.[_0x1031f3(0x142)]?.['conversation']||_0x5cfdcd['buttonsResponseMessage']?.[_0x1031f3(0x178)]||_0x5cfdcd[_0x1031f3(0x156)]?.[_0x1031f3(0x154)]?.[_0x1031f3(0x158)]||_0x5cfdcd[_0x1031f3(0x167)]?.[_0x1031f3(0x157)]||_0x5cfdcd[_0x1031f3(0x173)]?.['message']?.[_0x1031f3(0x143)]?.[_0x1031f3(0x173)]?.[_0x1031f3(0x165)]||_0x5cfdcd[_0x1031f3(0x159)]?.[_0x1031f3(0x14f)]?.['paramsJson']&&((()=>{const _0x2bed98=_0x1031f3;try{return JSON[_0x2bed98(0x174)](_0x5cfdcd[_0x2bed98(0x159)][_0x2bed98(0x14f)][_0x2bed98(0x148)])['id'];}catch{return'';}})())||_0x5cfdcd['groupStatusMentionMessage']?.[_0x1031f3(0x142)]?.[_0x1031f3(0x143)]?.[_0x1031f3(0x173)]?.[_0x1031f3(0x165)]||_0x5cfdcd[_0x1031f3(0x145)]?.[_0x1031f3(0x142)]?.[_0x1031f3(0x172)]?.[_0x1031f3(0x15a)]||_0x5cfdcd[_0x1031f3(0x145)]?.[_0x1031f3(0x142)]?.[_0x1031f3(0x165)]||'';};exports[_0x281aaa(0x15b)]=extractMessageContent;const shouldIgnoreMessage=_0x30aca1=>{const _0x2938be=_0x281aaa;if(!_0x30aca1[_0x2938be(0x142)])return!![];const _0x522d65=(0x0,exports['unwrapMessage'])(_0x30aca1[_0x2938be(0x142)]),_0x53217c=_0x522d65?.[_0x2938be(0x165)]||_0x522d65?.[_0x2938be(0x172)]?.[_0x2938be(0x15a)]||_0x522d65?.[_0x2938be(0x14b)]||_0x522d65?.[_0x2938be(0x14c)]||_0x522d65?.[_0x2938be(0x145)];if(_0x53217c)return![];if(_0x522d65?.[_0x2938be(0x143)])return!![];if(_0x522d65?.[_0x2938be(0x17e)])return!![];if(_0x522d65?.[_0x2938be(0x152)])return!![];if(_0x522d65?.['pollUpdateMessage'])return!![];return![];};function _0x51f2(_0x3719aa,_0x51addb){_0x3719aa=_0x3719aa-0x142;const _0xa685cf=_0xa685();let _0x51f283=_0xa685cf[_0x3719aa];if(_0x51f2['SgIkBT']===undefined){var _0x1b2907=function(_0x279083){const _0x2f7545='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4d47af='',_0x153904='';for(let _0x499754=0x0,_0xcd426d,_0x8d686b,_0x590a0f=0x0;_0x8d686b=_0x279083['charAt'](_0x590a0f++);~_0x8d686b&&(_0xcd426d=_0x499754%0x4?_0xcd426d*0x40+_0x8d686b:_0x8d686b,_0x499754++%0x4)?_0x4d47af+=String['fromCharCode'](0xff&_0xcd426d>>(-0x2*_0x499754&0x6)):0x0){_0x8d686b=_0x2f7545['indexOf'](_0x8d686b);}for(let _0x5e5679=0x0,_0x4d24f5=_0x4d47af['length'];_0x5e5679<_0x4d24f5;_0x5e5679++){_0x153904+='%'+('00'+_0x4d47af['charCodeAt'](_0x5e5679)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x153904);};_0x51f2['kGlaPK']=_0x1b2907,_0x51f2['CxIFdk']={},_0x51f2['SgIkBT']=!![];}const _0x1a95dc=_0xa685cf[0x0],_0x2b6328=_0x3719aa+_0x1a95dc,_0x49855c=_0x51f2['CxIFdk'][_0x2b6328];return!_0x49855c?(_0x51f283=_0x51f2['kGlaPK'](_0x51f283),_0x51f2['CxIFdk'][_0x2b6328]=_0x51f283):_0x51f283=_0x49855c,_0x51f283;}exports['shouldIgnoreMessage']=shouldIgnoreMessage;const isOwner=(_0x17e7c5,_0x1077bc,_0x2a54c3)=>{const _0x14190b=_0x281aaa,_0x4e6f3c={'hgMTM':'@lid','QHhES':function(_0x3e9fa6,_0x5ce1d4){return _0x3e9fa6===_0x5ce1d4;},'wSrSc':'hTUyj'};if(_0x1077bc[_0x14190b(0x144)][_0x14190b(0x16d)])return!![];const _0x2714c4=_0x1077bc['key'][_0x14190b(0x16a)],_0x29ab04=_0x2714c4[_0x14190b(0x15f)]('@g.us'),_0x41dfa3=_0x29ab04?_0x1077bc['key'][_0x14190b(0x175)]||_0x1077bc['participant']||'':_0x2714c4,_0x122eba=_0x41dfa3[_0x14190b(0x14d)]('@')[0x0][_0x14190b(0x14d)](':')[0x0],_0x22fc65=_0x17e7c5[_0x14190b(0x153)]?.['id']?.[_0x14190b(0x14d)](':')[0x0]?.[_0x14190b(0x14d)]('@')[0x0],_0x5b518b=_0x17e7c5[_0x14190b(0x153)]?.['lid']?.[_0x14190b(0x14d)]('@')[0x0];console[_0x14190b(0x15d)](_0x14190b(0x17a)+_0x122eba+'\x20|\x20BotPhone:\x20'+_0x22fc65+_0x14190b(0x17b)+_0x5b518b+_0x14190b(0x149)+_0x4e6f3c['QHhES'](_0x122eba,_0x5b518b));if(_0x22fc65&&_0x122eba===_0x22fc65)return!![];if(_0x5b518b&&_0x122eba===_0x5b518b)return!![];if(_0x2a54c3){const _0x1b3d85=Array[_0x14190b(0x16f)](_0x2a54c3)?_0x2a54c3:[_0x2a54c3];for(const _0x371e11 of _0x1b3d85){if(_0x4e6f3c['QHhES'](_0x4e6f3c[_0x14190b(0x16c)],_0x4e6f3c['wSrSc'])){const _0x583d1e=_0x371e11[_0x14190b(0x14d)]('@')[0x0][_0x14190b(0x14d)](':')[0x0];if(_0x122eba===_0x583d1e)return!![];if(_0x41dfa3[_0x14190b(0x15f)](_0x4e6f3c['hgMTM'])&&_0x122eba===_0x583d1e)return!![];}else{const _0x49cc97=_0x2df12d[_0x14190b(0x16f)](_0x3cc2f9)?_0x1c2779:[_0x14207e];for(const _0x467404 of _0x49cc97){const _0x4e1b6b=_0x467404[_0x14190b(0x14d)]('@')[0x0][_0x14190b(0x14d)](':')[0x0];if(_0xeb88b7===_0x4e1b6b)return!![];if(_0x29f682[_0x14190b(0x15f)](_0x4e6f3c[_0x14190b(0x16b)])&&_0x4e6f3c[_0x14190b(0x15c)](_0x36ece9,_0x4e1b6b))return!![];}}}}if(_0x41dfa3['endsWith'](_0x14190b(0x15e)))return console[_0x14190b(0x15d)](_0x14190b(0x14a)+_0x41dfa3),!![];return![];};exports[_0x281aaa(0x176)]=isOwner;