vinzzsync-wacli 1.0.0

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.
Files changed (49) hide show
  1. package/c.js +2 -0
  2. package/func.js +3263 -0
  3. package/index.js +2416 -0
  4. package/index2.js +3611 -0
  5. package/lib/sqlAuth.js +109 -0
  6. package/package.json +21 -0
  7. package/plugins/_loader.js +191 -0
  8. package/plugins/addplugins.js +93 -0
  9. package/plugins/backup.js +91 -0
  10. package/plugins/cekch.js +157 -0
  11. package/plugins/cekgb.js +105 -0
  12. package/plugins/clear.js +12 -0
  13. package/plugins/cmd.js +69 -0
  14. package/plugins/cmfil.js +110 -0
  15. package/plugins/cms.js +474 -0
  16. package/plugins/delplugins.js +57 -0
  17. package/plugins/dmsg.js +112 -0
  18. package/plugins/eval.js +175 -0
  19. package/plugins/evfil.js +86 -0
  20. package/plugins/exit.js +11 -0
  21. package/plugins/fadm.js +107 -0
  22. package/plugins/fakemsg.js +154 -0
  23. package/plugins/fakesize.js +204 -0
  24. package/plugins/fclick.js +111 -0
  25. package/plugins/fitnah.js +87 -0
  26. package/plugins/getfile.js +169 -0
  27. package/plugins/getplugins.js +71 -0
  28. package/plugins/getquoted.js +76 -0
  29. package/plugins/getusn.js +92 -0
  30. package/plugins/groups.js +62 -0
  31. package/plugins/help.js +19 -0
  32. package/plugins/ht.js +45 -0
  33. package/plugins/ht2.js +59 -0
  34. package/plugins/ht3.js +66 -0
  35. package/plugins/isbot.js +177 -0
  36. package/plugins/listplugins.js +103 -0
  37. package/plugins/me.js +95 -0
  38. package/plugins/minigames.js +144 -0
  39. package/plugins/ping.js +124 -0
  40. package/plugins/quoted.js +102 -0
  41. package/plugins/rvo.js +88 -0
  42. package/plugins/savefile.js +334 -0
  43. package/plugins/send.js +52 -0
  44. package/plugins/session.js +18 -0
  45. package/plugins/smsg.js +204 -0
  46. package/plugins/status.js +18 -0
  47. package/plugins/typing_troll.js +91 -0
  48. package/pp.jpg +0 -0
  49. package/vkazee-send-message.js +1238 -0
@@ -0,0 +1,334 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ function getMessageContent(message) {
5
+ if (!message) return null;
6
+
7
+ if (message.ephemeralMessage?.message) {
8
+ return getMessageContent(message.ephemeralMessage.message);
9
+ }
10
+
11
+ if (message.viewOnceMessage?.message) {
12
+ return getMessageContent(message.viewOnceMessage.message);
13
+ }
14
+
15
+ if (message.viewOnceMessageV2?.message) {
16
+ return getMessageContent(message.viewOnceMessageV2.message);
17
+ }
18
+
19
+ if (message.viewOnceMessageV2Extension?.message) {
20
+ return getMessageContent(
21
+ message.viewOnceMessageV2Extension.message
22
+ );
23
+ }
24
+
25
+ return message;
26
+ }
27
+
28
+ function getQuotedType(message) {
29
+ const content = getMessageContent(message);
30
+
31
+ if (!content) return null;
32
+
33
+ if (content.documentMessage) return 'document';
34
+ if (content.imageMessage) return 'image';
35
+ if (content.videoMessage) return 'video';
36
+ if (content.audioMessage) return 'audio';
37
+ if (content.conversation) return 'text';
38
+ if (content.extendedTextMessage) return 'text';
39
+
40
+ return null;
41
+ }
42
+
43
+ function getText(message) {
44
+ const content = getMessageContent(message);
45
+
46
+ if (!content) return '';
47
+
48
+ if (typeof content.conversation === 'string') {
49
+ return content.conversation;
50
+ }
51
+
52
+ if (typeof content.extendedTextMessage?.text === 'string') {
53
+ return content.extendedTextMessage.text;
54
+ }
55
+
56
+ return '';
57
+ }
58
+
59
+ function getExtension(type, message, fileName) {
60
+ if (fileName) {
61
+ const ext = path.extname(fileName);
62
+
63
+ if (ext) {
64
+ return ext;
65
+ }
66
+ }
67
+
68
+ const content = getMessageContent(message);
69
+
70
+ if (type === 'image') {
71
+ const mime = content?.imageMessage?.mimetype || '';
72
+
73
+ if (mime.includes('png')) return '.png';
74
+ if (mime.includes('webp')) return '.webp';
75
+
76
+ return '.jpg';
77
+ }
78
+
79
+ if (type === 'video') {
80
+ const mime = content?.videoMessage?.mimetype || '';
81
+
82
+ if (mime.includes('webm')) return '.webm';
83
+ if (mime.includes('3gp')) return '.3gp';
84
+
85
+ return '.mp4';
86
+ }
87
+
88
+ if (type === 'audio') {
89
+ const mime = content?.audioMessage?.mimetype || '';
90
+
91
+ if (mime.includes('ogg')) return '.ogg';
92
+ if (mime.includes('opus')) return '.opus';
93
+ if (mime.includes('mpeg')) return '.mp3';
94
+ if (mime.includes('mp4')) return '.m4a';
95
+
96
+ return '.ogg';
97
+ }
98
+
99
+ return '';
100
+ }
101
+
102
+ function sanitizeName(name) {
103
+ return String(name || '')
104
+ .trim()
105
+ .replace(/[<>:"/\\|?*\x00-\x1F]/g, '_');
106
+ }
107
+
108
+ export default {
109
+ command: 'sf',
110
+
111
+ async run(ctx) {
112
+ const {
113
+ m,
114
+ text,
115
+ args,
116
+ sock
117
+ } = ctx;
118
+
119
+ if (!m?.chat) {
120
+ return;
121
+ }
122
+
123
+ const input = String(text || '').trim();
124
+
125
+ if (!input) {
126
+ await m.reply({
127
+ text: 'Gunakan:\n.sf <code> <nama>\natau reply file/pesan dengan .sf <nama>'
128
+ });
129
+ return;
130
+ }
131
+
132
+ let fileName = '';
133
+ let sourceText = '';
134
+ let quotedType = null;
135
+
136
+ if (m.quoted?.message) {
137
+ fileName = sanitizeName(
138
+ args?.[0] || ''
139
+ );
140
+
141
+ if (!fileName) {
142
+ await m.reply({
143
+ text: 'Masukkan nama file.\nContoh: .sf foto.jpg'
144
+ });
145
+ return;
146
+ }
147
+
148
+ quotedType = getQuotedType(
149
+ m.quoted.message
150
+ );
151
+
152
+ if (!quotedType) {
153
+ await m.reply({
154
+ text: 'Tipe pesan tidak didukung.'
155
+ });
156
+ return;
157
+ }
158
+ } else {
159
+ if (!args || args.length < 2) {
160
+ await m.reply({
161
+ text: 'Gunakan:\n.sf <code> <nama>'
162
+ });
163
+ return;
164
+ }
165
+
166
+ fileName = sanitizeName(
167
+ args[args.length - 1]
168
+ );
169
+
170
+ sourceText = input
171
+ .slice(
172
+ 0,
173
+ input.length - fileName.length
174
+ )
175
+ .trim();
176
+
177
+ if (!sourceText) {
178
+ await m.reply({
179
+ text: 'Code/teks tidak boleh kosong.'
180
+ });
181
+ return;
182
+ }
183
+ }
184
+
185
+ if (!fileName) {
186
+ await m.reply({
187
+ text: 'Nama file tidak valid.'
188
+ });
189
+ return;
190
+ }
191
+
192
+ if (
193
+ fileName === '.' ||
194
+ fileName === '..' ||
195
+ fileName.includes('\0')
196
+ ) {
197
+ await m.reply({
198
+ text: 'Nama file tidak valid.'
199
+ });
200
+ return;
201
+ }
202
+
203
+ const filePath = path.resolve(
204
+ './',
205
+ fileName
206
+ );
207
+
208
+ if (m.quoted?.message) {
209
+ try {
210
+ if (quotedType === 'text') {
211
+ const content =
212
+ getText(m.quoted.message);
213
+
214
+ if (!content) {
215
+ await m.reply({
216
+ text: 'Teks pada pesan tidak ditemukan.'
217
+ });
218
+ return;
219
+ }
220
+
221
+ fs.writeFileSync(
222
+ filePath,
223
+ content,
224
+ 'utf8'
225
+ );
226
+
227
+ await m.reply({
228
+ text: `File berhasil disimpan: ${fileName}`
229
+ });
230
+
231
+ return;
232
+ }
233
+
234
+ const extension =
235
+ getExtension(
236
+ quotedType,
237
+ m.quoted.message,
238
+ fileName
239
+ );
240
+
241
+ if (
242
+ !path.extname(fileName) &&
243
+ extension
244
+ ) {
245
+ fileName += extension;
246
+ }
247
+
248
+ const finalPath = path.resolve(
249
+ './',
250
+ fileName
251
+ );
252
+
253
+ if (
254
+ !finalPath.startsWith(
255
+ path.resolve('./') +
256
+ path.sep
257
+ )
258
+ ) {
259
+ await m.reply({
260
+ text: 'Path file tidak valid.'
261
+ });
262
+ return;
263
+ }
264
+
265
+ const buffer =
266
+ await sock.downloadMediaMessage(
267
+ m.quoted,
268
+ 'buffer',
269
+ {}
270
+ );
271
+
272
+ if (!buffer) {
273
+ throw new Error(
274
+ 'Gagal mengambil media dari pesan.'
275
+ );
276
+ }
277
+
278
+ fs.writeFileSync(
279
+ finalPath,
280
+ buffer
281
+ );
282
+
283
+ await m.reply({
284
+ text: `File berhasil disimpan: ${fileName}`
285
+ });
286
+
287
+ return;
288
+ } catch (error) {
289
+ console.error('[sf]', error);
290
+
291
+ await m.reply({
292
+ text: `Gagal menyimpan file: ${error?.message || error}`
293
+ });
294
+
295
+ return;
296
+ }
297
+ }
298
+
299
+ try {
300
+ const finalPath = path.resolve(
301
+ './',
302
+ fileName
303
+ );
304
+
305
+ if (
306
+ !finalPath.startsWith(
307
+ path.resolve('./') +
308
+ path.sep
309
+ )
310
+ ) {
311
+ await m.reply({
312
+ text: 'Path file tidak valid.'
313
+ });
314
+ return;
315
+ }
316
+
317
+ fs.writeFileSync(
318
+ finalPath,
319
+ sourceText,
320
+ 'utf8'
321
+ );
322
+
323
+ await m.reply({
324
+ text: `File berhasil disimpan: ${fileName}`
325
+ });
326
+ } catch (error) {
327
+ console.error('[sf]', error);
328
+
329
+ await m.reply({
330
+ text: `Gagal menyimpan file: ${error?.message || error}`
331
+ });
332
+ }
333
+ }
334
+ };
@@ -0,0 +1,52 @@
1
+ function out(m, ...args) {
2
+ if (m?.reply) {
3
+ const text = args.map(v => typeof v === "string" ? v : String(v)).join(" ");
4
+ void m.reply({ text });
5
+ } else {
6
+ console.log(...args);
7
+ }
8
+ }
9
+
10
+ export default {
11
+ command: 'send',
12
+
13
+ async run({
14
+ m,
15
+ args,
16
+ normalizeJid,
17
+ warn,
18
+ debug,
19
+ sock,
20
+ info
21
+ }) {
22
+ if (args.length < 2) {
23
+ out(m, 'Gunakan: send <nomor> <pesan>');
24
+ return;
25
+ }
26
+
27
+ const target = normalizeJid(args.shift());
28
+ const message = args.join(' ');
29
+
30
+ if (!target) {
31
+ out(m, 'Nomor/JID tidak valid.');
32
+ return;
33
+ }
34
+
35
+ debug('sendMessage', {
36
+ target,
37
+ message
38
+ });
39
+
40
+ await sock.sendMessage(
41
+ target,
42
+ {
43
+ text: message
44
+ },
45
+ {
46
+ quoted: global.v
47
+ }
48
+ );
49
+
50
+ out(m, `Pesan terkirim ke ${target}`);
51
+ }
52
+ };
@@ -0,0 +1,18 @@
1
+ function out(m, text) {
2
+ if (m?.reply) {
3
+ void m.reply({ text });
4
+ } else {
5
+ console.log(text);
6
+ }
7
+ }
8
+
9
+ export default {
10
+ command: 'session',
11
+
12
+ async run({ m, detectSession, debug }) {
13
+ const detected = detectSession();
14
+ debug('Session details', detected.details);
15
+ const text = `======= SESSION DETECT =======\nType : ${detected.type}\nPath : ${detected.path ?? '-'}\nRegistered : ${detected.registered}\n==============================`;
16
+ out(m, text);
17
+ }
18
+ };
@@ -0,0 +1,204 @@
1
+ function out(m, ...args) {
2
+ const text = args
3
+ .map(v => typeof v === "string" ? v : String(v))
4
+ .join(" ");
5
+
6
+ if (m?.reply) {
7
+ void m.reply({ text });
8
+ } else {
9
+ console.log(...args);
10
+ }
11
+ }
12
+
13
+ export default {
14
+ command: 'smsg',
15
+
16
+ async run({
17
+ text,
18
+ m,
19
+ messageStore,
20
+ getMessageType,
21
+ MAX_MESSAGES
22
+ }) {
23
+ const input = text.trim();
24
+
25
+ if (!input) {
26
+ out(m, 'Gunakan: smsg [text],[nomor],[jid],[messageId]');
27
+ return;
28
+ }
29
+
30
+ const parts = input.split(',');
31
+
32
+ const searchText =
33
+ String(parts[0] || '').trim().toLowerCase();
34
+
35
+ const searchNumber =
36
+ String(parts[1] || '').trim().replace(/\D/g, '');
37
+
38
+ const inputJid =
39
+ String(parts[2] || '').trim().toLowerCase();
40
+
41
+ const inputId =
42
+ String(parts[3] || '').trim();
43
+
44
+ const searchJid =
45
+ String(inputJid || m?.chat || '')
46
+ .trim()
47
+ .toLowerCase();
48
+
49
+ const searchMessageId = inputId;
50
+
51
+ const results = [];
52
+
53
+ function getMessageText(message) {
54
+ let msg = message?.message;
55
+
56
+ if (!msg) return '';
57
+
58
+ if (msg.ephemeralMessage?.message) {
59
+ msg = msg.ephemeralMessage.message;
60
+ }
61
+
62
+ if (msg.viewOnceMessage?.message) {
63
+ msg = msg.viewOnceMessage.message;
64
+ }
65
+
66
+ if (msg.viewOnceMessageV2?.message) {
67
+ msg = msg.viewOnceMessageV2.message;
68
+ }
69
+
70
+ if (msg.viewOnceMessageV2Extension?.message) {
71
+ msg = msg.viewOnceMessageV2Extension.message;
72
+ }
73
+
74
+ if (msg.documentWithCaptionMessage?.message) {
75
+ msg = msg.documentWithCaptionMessage.message;
76
+ }
77
+
78
+ return String(
79
+ msg.conversation ||
80
+ msg.extendedTextMessage?.text ||
81
+ msg.imageMessage?.caption ||
82
+ msg.videoMessage?.caption ||
83
+ msg.documentMessage?.caption ||
84
+ msg.documentWithCaptionMessage?.message?.documentMessage?.caption ||
85
+ ''
86
+ );
87
+ }
88
+
89
+ for (const [storeKey, message] of messageStore.entries()) {
90
+ const key = message?.key || {};
91
+
92
+ const remoteJid =
93
+ String(key.remoteJid || '')
94
+ .trim()
95
+ .toLowerCase();
96
+
97
+ const participantJid =
98
+ String(
99
+ key.participant ||
100
+ key.senderPn ||
101
+ key.participantPn ||
102
+ ''
103
+ )
104
+ .trim()
105
+ .toLowerCase();
106
+
107
+ const senderNumber =
108
+ participantJid
109
+ .split('@')[0]
110
+ .split(':')[0]
111
+ .replace(/\D/g, '');
112
+
113
+ const messageId = String(key.id || '');
114
+
115
+ if (
116
+ searchMessageId &&
117
+ messageId !== searchMessageId
118
+ ) {
119
+ continue;
120
+ }
121
+
122
+ const messageText = getMessageText(message);
123
+ const lowerText = messageText.toLowerCase();
124
+ const type = getMessageType(message);
125
+
126
+ if (
127
+ searchText &&
128
+ !lowerText.startsWith(searchText)
129
+ ) {
130
+ continue;
131
+ }
132
+
133
+ if (
134
+ searchNumber &&
135
+ !senderNumber.includes(searchNumber)
136
+ ) {
137
+ continue;
138
+ }
139
+
140
+ if (
141
+ searchJid &&
142
+ remoteJid !== searchJid
143
+ ) {
144
+ continue;
145
+ }
146
+
147
+ results.push({
148
+ storeKey,
149
+ messageId,
150
+ remoteJid,
151
+ participantJid,
152
+ senderNumber,
153
+ fromMe: !!key.fromMe,
154
+ timestamp:
155
+ message?.messageTimestamp ??
156
+ message?.timestamp ??
157
+ '-',
158
+ type,
159
+ text:
160
+ messageText ||
161
+ '[non-text / tanpa caption]',
162
+ raw: message
163
+ });
164
+ }
165
+
166
+ let output = '';
167
+
168
+ if (!results.length) {
169
+ output += '\x1b[31mTidak ada pesan yang cocok.\x1b[0m\n\n';
170
+ output += `Text : ${searchText || '(semua)'}\n`;
171
+ output += `Nomor : ${searchNumber || '(semua)'}\n`;
172
+ output += `JID : ${searchJid || '(semua)'}\n`;
173
+ output += `ID : ${searchMessageId || '(semua)'}\n`;
174
+ output += `Cache : ${messageStore.size}/${MAX_MESSAGES}`;
175
+
176
+ out(m, output);
177
+ return;
178
+ }
179
+
180
+ output += '\n';
181
+ output += '\x1b[36m==================== SMESSAGE SEARCH ====================\x1b[0m\n\n';
182
+ output += `Query : ${searchText || '(semua)'}\n`;
183
+ output += `Nomor : ${searchNumber || '(semua)'}\n`;
184
+ output += `JID : ${searchJid || '(semua)'}\n`;
185
+ output += `Hasil : ${results.length}\n\n`;
186
+
187
+ results.forEach((item, index) => {
188
+ output += `\x1b[33m[${index + 1}]\x1b[0m\n`;
189
+ output += ` Sender : ${item.senderNumber || item.participantJid || '-'}\n`;
190
+ output += ` Sender JID : ${item.participantJid || '-'}\n`;
191
+ output += ` Target JID : ${item.remoteJid || '-'}\n`;
192
+ output += ` Message ID : ${item.messageId || '-'}\n`;
193
+ output += ` Type : ${item.type}\n`;
194
+ output += ` From Me : ${item.fromMe}\n`;
195
+ output += ` Timestamp : ${item.timestamp}\n`;
196
+ output += ` Text : ${item.text}\n`;
197
+ output += ` Store Key : ${item.storeKey}\n\n`;
198
+ });
199
+
200
+ output += '\x1b[36m==========================================================\x1b[0m';
201
+
202
+ out(m, output);
203
+ }
204
+ };
@@ -0,0 +1,18 @@
1
+ function out(m, text) {
2
+ if (m?.reply) {
3
+ void m.reply({ text });
4
+ } else {
5
+ console.log(text);
6
+ }
7
+ }
8
+
9
+ export default {
10
+ command: 'status',
11
+
12
+ async run({ m, connectionState, sessionType, sessionPath, reconnectAttempts, messageCount, currentWaVersion, lastDisconnect, debug }) {
13
+ const memory = process.memoryUsage();
14
+ const text = `========== STATUS ==========\nNode : ${process.version}\nPlatform : ${process.platform}\nArchitecture: ${process.arch}\nPID : ${process.pid}\nConnection : ${connectionState}\nSession : ${sessionType}\nSession path: ${sessionPath ?? '-'}\nReconnect : ${reconnectAttempts}\nMessages : ${messageCount}\nWA version : ${currentWaVersion ? currentWaVersion.join('.') : '-'}\nRSS : ${Math.round(memory.rss / 1024 / 1024)} MB\n=============================`;
15
+ debug('Last disconnect', lastDisconnect);
16
+ out(m, text);
17
+ }
18
+ };
@@ -0,0 +1,91 @@
1
+ let trollTypingLoops = {};
2
+
3
+ function delay(ms) {
4
+ return new Promise(resolve => setTimeout(resolve, ms));
5
+ }
6
+
7
+ export default {
8
+ command: ['type-troll', 'typet'],
9
+
10
+ async run({ m, args, sock }) {
11
+ if (!m.isGroup) {
12
+ await m.reply({
13
+ text: 'Fitur ini hanya untuk grup.'
14
+ });
15
+ return;
16
+ }
17
+
18
+ const act =
19
+ (args[0] || '').toLowerCase();
20
+
21
+ if (!['on', 'off'].includes(act)) {
22
+ await m.reply({
23
+ text:
24
+ 'Gunakan format:\n' +
25
+ '.typet on\n' +
26
+ '.typet off'
27
+ });
28
+ return;
29
+ }
30
+
31
+ if (act === 'on') {
32
+ if (trollTypingLoops[m.chat]) {
33
+ await m.reply({
34
+ text:
35
+ '❗Typing Troll sudah aktif.'
36
+ });
37
+ return;
38
+ }
39
+
40
+ trollTypingLoops[m.chat] =
41
+ setInterval(async () => {
42
+ try {
43
+ await sock.sendPresenceUpdate(
44
+ 'composing',
45
+ m.chat
46
+ );
47
+
48
+ await delay(300);
49
+
50
+ await sock.sendPresenceUpdate(
51
+ 'paused',
52
+ m.chat
53
+ );
54
+ } catch (error) {
55
+ console.error(
56
+ 'TrollTyping Error:',
57
+ error
58
+ );
59
+ }
60
+ }, 200);
61
+
62
+ await m.reply({
63
+ text:
64
+ '✅ Auto Typing Troll diaktifkan.'
65
+ });
66
+
67
+ return;
68
+ }
69
+
70
+ if (act === 'off') {
71
+ if (!trollTypingLoops[m.chat]) {
72
+ await m.reply({
73
+ text:
74
+ '❗ Typing Troll belum aktif.'
75
+ });
76
+ return;
77
+ }
78
+
79
+ clearInterval(
80
+ trollTypingLoops[m.chat]
81
+ );
82
+
83
+ delete trollTypingLoops[m.chat];
84
+
85
+ await m.reply({
86
+ text:
87
+ '❌ Typing Troll dimatikan.'
88
+ });
89
+ }
90
+ }
91
+ };