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
package/plugins/cms.js ADDED
@@ -0,0 +1,474 @@
1
+ import { AIRich, copyNForward } from '../func.js';
2
+
3
+ function out(m, ...args) {
4
+ const text = args
5
+ .map(value =>
6
+ typeof value === 'string'
7
+ ? value
8
+ : String(value)
9
+ )
10
+ .join(' ');
11
+
12
+ if (m?.reply) {
13
+ void m.reply({ text });
14
+ } else {
15
+ console.log(text);
16
+ }
17
+ }
18
+
19
+ function serialize(value, depth = 0, seen = new WeakSet()) {
20
+ if (value === undefined) return 'undefined';
21
+ if (value === null) return 'null';
22
+
23
+ if (typeof value === 'string') {
24
+ return JSON.stringify(value);
25
+ }
26
+
27
+ if (typeof value === 'number') {
28
+ if (Number.isNaN(value)) return 'NaN';
29
+ if (value === Infinity) return 'Infinity';
30
+ if (value === -Infinity) return '-Infinity';
31
+ return String(value);
32
+ }
33
+
34
+ if (typeof value === 'bigint') {
35
+ return `${value}n`;
36
+ }
37
+
38
+ if (typeof value === 'boolean') {
39
+ return String(value);
40
+ }
41
+
42
+ if (typeof value === 'function') {
43
+ return value.toString();
44
+ }
45
+
46
+ if (
47
+ typeof Buffer !== 'undefined' &&
48
+ Buffer.isBuffer(value)
49
+ ) {
50
+ return `Buffer.from(${JSON.stringify([...value])})`;
51
+ }
52
+
53
+ if (value instanceof Uint8Array) {
54
+ return `Buffer.from(${JSON.stringify([...value])})`;
55
+ }
56
+
57
+ if (value instanceof ArrayBuffer) {
58
+ return `Buffer.from(new Uint8Array(${serialize(
59
+ value,
60
+ depth + 1,
61
+ seen
62
+ )}))`;
63
+ }
64
+
65
+ if (value instanceof Date) {
66
+ return `new Date(${JSON.stringify(
67
+ value.toISOString()
68
+ )})`;
69
+ }
70
+
71
+ if (typeof value !== 'object') {
72
+ return JSON.stringify(value);
73
+ }
74
+
75
+ if (seen.has(value)) {
76
+ return 'undefined';
77
+ }
78
+
79
+ seen.add(value);
80
+
81
+ if (depth > 100) {
82
+ seen.delete(value);
83
+ return '{}';
84
+ }
85
+
86
+ if (Array.isArray(value)) {
87
+ const items = value.map(item =>
88
+ serialize(item, depth + 1, seen)
89
+ );
90
+
91
+ seen.delete(value);
92
+
93
+ return `[
94
+ ${items
95
+ .map(item =>
96
+ `${' '.repeat(depth + 1)}${item}`
97
+ )
98
+ .join(',\n')}
99
+ ${' '.repeat(depth)}]`;
100
+ }
101
+
102
+ const entries = Object.entries(value);
103
+
104
+ const body = entries
105
+ .map(([key, item]) => {
106
+ const property =
107
+ /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key)
108
+ ? key
109
+ : JSON.stringify(key);
110
+
111
+ return `${' '.repeat(depth + 1)}${property}: ${serialize(
112
+ item,
113
+ depth + 1,
114
+ seen
115
+ )}`;
116
+ })
117
+ .join(',\n');
118
+
119
+ seen.delete(value);
120
+
121
+ return `{
122
+ ${body}
123
+ ${' '.repeat(depth)}}`;
124
+ }
125
+
126
+ function getSourceKey(message) {
127
+ return {
128
+ remoteJid:
129
+ message?.key?.remoteJid ?? null,
130
+
131
+ id:
132
+ message?.key?.id ?? null,
133
+
134
+ participant:
135
+ message?.key?.participant ?? null,
136
+
137
+ senderPn:
138
+ message?.key?.senderPn ?? null,
139
+
140
+ participantPn:
141
+ message?.key?.participantPn ?? null,
142
+
143
+ fromMe:
144
+ message?.key?.fromMe ?? false
145
+ };
146
+ }
147
+
148
+ function getMessageType(message, getMessageTypeFn) {
149
+ if (typeof getMessageTypeFn === 'function') {
150
+ const type =
151
+ getMessageTypeFn(message);
152
+
153
+ if (type && type !== 'unknown') {
154
+ return type;
155
+ }
156
+ }
157
+
158
+ if (
159
+ message &&
160
+ typeof message === 'object'
161
+ ) {
162
+ return Object.keys(message)[0] || 'unknown';
163
+ }
164
+
165
+ return 'unknown';
166
+ }
167
+
168
+ function resolveTargetAndMessage({
169
+ m,
170
+ text,
171
+ messageStore
172
+ }) {
173
+ const input =
174
+ String(text || '')
175
+ .trim()
176
+ .split(/\s+/)
177
+ .filter(Boolean);
178
+
179
+ let targetJid =
180
+ m?.chat || null;
181
+
182
+ let messageId =
183
+ m?.quoted?.id || null;
184
+
185
+ if (input.length >= 2) {
186
+ targetJid = input[0];
187
+ messageId = input[1];
188
+ } else if (input.length === 1) {
189
+ messageId = input[0];
190
+ }
191
+
192
+ if (!targetJid || !messageId) {
193
+ return {
194
+ targetJid,
195
+ messageId,
196
+ stored: null
197
+ };
198
+ }
199
+
200
+ const storeKey =
201
+ `${targetJid}:${messageId}`;
202
+
203
+ let stored =
204
+ messageStore?.get(storeKey) || null;
205
+
206
+ if (
207
+ !stored &&
208
+ m?.quoted?.message &&
209
+ m.quoted.id === messageId
210
+ ) {
211
+ stored = {
212
+ key: {
213
+ ...(m.quoted.key || {}),
214
+ id: messageId,
215
+ remoteJid:
216
+ m.quoted.key?.remoteJid ||
217
+ targetJid
218
+ },
219
+ message:
220
+ m.quoted.message
221
+ };
222
+ }
223
+
224
+ return {
225
+ targetJid,
226
+ messageId,
227
+ stored
228
+ };
229
+ }
230
+
231
+ function buildRelayCode(targetJid, message) {
232
+ const payload =
233
+ serialize(message);
234
+
235
+ return `const payload = ${payload};
236
+
237
+ await sock.relayMessage(
238
+ ${JSON.stringify(targetJid)},
239
+ payload,
240
+ {onTarget: true,
241
+ messageId: Date.now() + "VINZZ",
242
+ onTarget:true}
243
+ );`;
244
+ }
245
+
246
+ function buildForwardCode(targetJid, messageId) {
247
+ return `const source = messageStore.get(
248
+ ${JSON.stringify(`${targetJid}:${messageId}`)}
249
+ );
250
+
251
+ if (!source?.message) {
252
+ throw new Error("Source message tidak ditemukan");
253
+ }
254
+
255
+ await copyNForward(
256
+ sock,
257
+ ${JSON.stringify(targetJid)},
258
+ source,
259
+ true
260
+ );`;
261
+ }
262
+
263
+ export default {
264
+ command: 'cms',
265
+
266
+ async run(ctx) {
267
+ const {
268
+ m,
269
+ text,
270
+ messageStore,
271
+ getMessageType,
272
+ sock
273
+ } = ctx;
274
+
275
+ const {
276
+ targetJid,
277
+ messageId,
278
+ stored
279
+ } = resolveTargetAndMessage({
280
+ m,
281
+ text,
282
+ messageStore
283
+ });
284
+
285
+ if (!targetJid || !messageId) {
286
+ const usage = `CREATE MESSAGE SEND (CMS)
287
+
288
+ Cara pakai:
289
+ .cms <reply pesan>
290
+ .cms <messageId>
291
+ .cms <jid> <messageId>`;
292
+
293
+ if (m?.reply) {
294
+ await m.reply({
295
+ text: usage
296
+ });
297
+ } else {
298
+ out(m, usage);
299
+ }
300
+
301
+ return;
302
+ }
303
+
304
+ if (!stored?.message) {
305
+ const result = `CREATE MESSAGE SEND (CMS)
306
+
307
+ • Status : Message tidak ditemukan
308
+ • Chat : ${targetJid}
309
+ • ID : ${messageId}
310
+ • Source : messageStore`;
311
+
312
+ if (m?.reply) {
313
+ await m.reply({
314
+ text: result
315
+ });
316
+ } else {
317
+ out(m, result);
318
+ }
319
+
320
+ return;
321
+ }
322
+
323
+ const rawMessage =
324
+ stored.message;
325
+
326
+ const messageType =
327
+ getMessageType(
328
+ rawMessage,
329
+ getMessageType
330
+ );
331
+
332
+ const sourceKey =
333
+ getSourceKey(stored);
334
+
335
+ const sender =
336
+ stored.key?.participant ||
337
+ stored.key?.senderPn ||
338
+ stored.key?.participantPn ||
339
+ stored.key?.remoteJid ||
340
+ 'unknown';
341
+
342
+ const generated =
343
+ buildRelayCode(
344
+ targetJid,
345
+ rawMessage
346
+ );
347
+
348
+ const forwardGenerated =
349
+ buildForwardCode(
350
+ targetJid,
351
+ messageId
352
+ );
353
+
354
+ const info = `• Type : ${messageType}
355
+ • Source : Raw WebMessageInfo
356
+ • Chat : ${targetJid}
357
+ • ID : ${stored.key?.id || messageId}
358
+ • Sender : ${sender}
359
+ • From Me : ${sourceKey.fromMe}
360
+ • Payload : Full message.message
361
+ • Context : Preserved
362
+ • Quoted : Preserved
363
+ • Media : Preserved
364
+ • Forward : copyNForward`;
365
+
366
+ if (m?.reply) {
367
+ const isLong =
368
+ generated.length > 1000;
369
+
370
+ const rich =
371
+ new AIRich(sock)
372
+ .setTitle(
373
+ 'CREATE MESSAGE SEND (CMS)'
374
+ )
375
+ .addText(
376
+ info,
377
+ {
378
+ id: 'cms_info'
379
+ }
380
+ );
381
+
382
+ if (!isLong) {
383
+ rich.addCode(
384
+ 'javascript',
385
+ generated,
386
+ {
387
+ insertAt: 'cms_info',
388
+ id: 'cms_code'
389
+ }
390
+ );
391
+ }
392
+
393
+ rich.setFooter(
394
+ isLong
395
+ ? 'Code dikirim sebagai file'
396
+ : 'Generated by CMS'
397
+ );
398
+
399
+ const sent =
400
+ await rich.send(
401
+ targetJid,
402
+ { onTarget: true,
403
+ messageId:
404
+ `VINZZCMS-${Date.now()}`
405
+ }
406
+ );
407
+
408
+ messageStore.set(
409
+ `${targetJid}:${sent.key.id}`,
410
+ sent
411
+ );
412
+
413
+ if (isLong) {
414
+ const fileMessage =
415
+ await sock.sendMessage(
416
+ targetJid,
417
+ {
418
+ document:
419
+ Buffer.from(
420
+ generated,
421
+ 'utf8'
422
+ ),
423
+ mimetype:
424
+ 'text/javascript',
425
+ fileName:
426
+ `cms-${Date.now()}.js`
427
+ },
428
+ {
429
+ quoted: global.v
430
+ }
431
+ );
432
+
433
+ if (fileMessage?.key?.id) {
434
+ messageStore.set(
435
+ `${targetJid}:${fileMessage.key.id}`,
436
+ fileMessage
437
+ );
438
+ }
439
+ }
440
+
441
+ return;
442
+ }
443
+
444
+ out(
445
+ m,
446
+ '\nCREATE MESSAGE SEND (CMS)\n'
447
+ );
448
+
449
+ out(
450
+ m,
451
+ info
452
+ );
453
+
454
+ out(
455
+ m,
456
+ '\nRELAY PAYLOAD\n'
457
+ );
458
+
459
+ out(
460
+ m,
461
+ generated
462
+ );
463
+
464
+ out(
465
+ m,
466
+ '\nFORWARD AS ORIGINAL\n'
467
+ );
468
+
469
+ out(
470
+ m,
471
+ forwardGenerated
472
+ );
473
+ }
474
+ };
@@ -0,0 +1,57 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ export default {
5
+ command: 'delplugins',
6
+
7
+ async run(ctx) {
8
+ const {
9
+ m,
10
+ args
11
+ } = ctx;
12
+
13
+ if (!m?.chat) return;
14
+
15
+ const name = String(args?.[0] || '')
16
+ .replace(/\.js$/i, '');
17
+
18
+ if (!name) {
19
+ await m.reply({
20
+ text: 'Gunakan: .delplugins <nama>'
21
+ });
22
+ return;
23
+ }
24
+
25
+ if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
26
+ await m.reply({
27
+ text: 'Nama plugin tidak valid.'
28
+ });
29
+ return;
30
+ }
31
+
32
+ if (name === '_loader') {
33
+ await m.reply({
34
+ text: 'Plugin loader tidak boleh dihapus.'
35
+ });
36
+ return;
37
+ }
38
+
39
+ const filePath = path.resolve(
40
+ './plugins',
41
+ `${name}.js`
42
+ );
43
+
44
+ if (!fs.existsSync(filePath)) {
45
+ await m.reply({
46
+ text: `Plugin tidak ditemukan: ${name}.js`
47
+ });
48
+ return;
49
+ }
50
+
51
+ fs.unlinkSync(filePath);
52
+
53
+ await m.reply({
54
+ text: `Plugin dihapus: ${name}.js`
55
+ });
56
+ }
57
+ };
@@ -0,0 +1,112 @@
1
+ export default {
2
+ command: 'dmsg',
3
+
4
+ async run({
5
+ text,
6
+ m,
7
+ sock,
8
+ delay
9
+ }) {
10
+ const dmsgArgs =
11
+ text.trim().split(/\s+/).filter(Boolean);
12
+
13
+ const chatId =
14
+ m?.chat || dmsgArgs[0];
15
+
16
+ const replyId =
17
+ m?.quoted?.id;
18
+
19
+ const cmdId =
20
+ m?.key?.id;
21
+
22
+ const targetId =
23
+ replyId ||
24
+ (m ? dmsgArgs[0] : dmsgArgs[1]);
25
+
26
+ if (!chatId || !targetId) {
27
+ return;
28
+ }
29
+
30
+ const dmsg = async (
31
+ jid,
32
+ stanzaId
33
+ ) => {
34
+ try {
35
+ const tempId =
36
+ await sock.relayMessage(
37
+ jid,
38
+ {
39
+ groupStatusMessageV2: {
40
+ message: {
41
+ extendedTextMessage: {
42
+ text: "",
43
+ contextInfo: {
44
+ isGroupStatus: true
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ {onTarget: true}
51
+ );
52
+
53
+ const tempId2 =
54
+ await sock.relayMessage(
55
+ jid,
56
+ {
57
+ protocolMessage: {
58
+ key: {
59
+ jid,
60
+ fromMe: true,
61
+ id: tempId
62
+ },
63
+ type: 14,
64
+ editedMessage: {
65
+ extendedTextMessage: {
66
+ text: "\0",
67
+ contextInfo: {
68
+ isGroupStatus: false
69
+ }
70
+ }
71
+ }
72
+ }
73
+ },
74
+ {onTarget: true,
75
+ messageId: stanzaId,
76
+ onTarget:true}
77
+ );
78
+
79
+ await delay(100);
80
+
81
+ await Promise.allSettled([
82
+ sock.sendMessage(jid, {
83
+ delete: {
84
+ remoteJid: jid,
85
+ id: tempId,
86
+ fromMe: true
87
+ }
88
+ }),
89
+ sock.sendMessage(jid, {
90
+ delete: {
91
+ remoteJid: jid,
92
+ id: tempId2,
93
+ fromMe: true
94
+ }
95
+ })
96
+ ]);
97
+ } catch {}
98
+ };
99
+
100
+ await dmsg(
101
+ chatId,
102
+ targetId
103
+ );
104
+
105
+ if (replyId && cmdId) {
106
+ await dmsg(
107
+ chatId,
108
+ cmdId
109
+ );
110
+ }
111
+ }
112
+ };