forked from zennn08/BaseSelfBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxinz.js
808 lines (791 loc) · 37.1 KB
/
xinz.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
/*
BY AQULZZ
*/
const
{
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
waChatKey,
mentionedJid,
processTime,
} = require("@adiwajshing/baileys");
const moment = require("moment-timezone");
const fs = require("fs");
const { exec } = require('child_process');
const aqul = require('./whatsapp/message.js');
const speed = require('performance-now');
const ffmpeg = require('fluent-ffmpeg');
const conn = require('./whatsapp/connect');
const { color } = require('./lib/color');
const mess = JSON.parse(fs.readFileSync('./whatsapp/mess.json'));
const axios = require('axios');
const Exif = require('./lib/exif');
const { uptotele, uptonaufal, uploadFile } = require('./lib/uploadimage')
const exif = new Exif();
conn.connect()
const xinz = conn.xinz
fake = "© 𝐗𝐢𝐧𝐳-𝐓𝐞𝐚𝐦"
fakeimage = fs.readFileSync("./media/aqul.jpeg")
prefix = 'z'
blocked = []
baterai = {
baterai: 0,
cas: false
}
public = false
xinz.on('CB:Blocklist', json => {
if (blocked.length > 2) return
for (let i of json[1].blocklist) {
blocked.push(i.replace('c.us','s.whatsapp.net'))
}
})
xinz.on('CB:action,,battery', json => {
const a = json[2][0][1].value
const b = json[2][0][1].live
baterai.baterai = a
baterai.cas = b
})
xinz.on('message-update', async (msg) => { // THX TO BANG HANIF
require('./antidelete/antidelete.js')(xinz, msg)
})
xinz.on('message-new', async(qul) => {
try {
if (!qul.message) return
if (qul.key && qul.key.remoteJid == 'status@broadcast') return
qul.message = (Object.keys(qul.message)[0] === 'ephemeralMessage') ? qul.message.ephemeralMessage.message : qul.message
let infoMSG = JSON.parse(fs.readFileSync(`./antidelete/msg.data.json`))
infoMSG.push(JSON.parse(JSON.stringify(qul)))
fs.writeFileSync(`./antidelete/msg.data.json`, JSON.stringify(infoMSG, null, 2))
const urutan_pesan = infoMSG.length
if (urutan_pesan === 5000) {
infoMSG.splice(0, 4300)
fs.writeFileSync(`./antidelete/msg.data.json`, JSON.stringify(infoMSG, null, 2))
}
global.prefix
const content = JSON.stringify(qul.message)
const from = qul.key.remoteJid
const type = Object.keys(qul.message)[0]
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')
body = (type === 'conversation' && qul.message.conversation.startsWith(prefix)) ? qul.message.conversation : (type == 'imageMessage') && qul.message.imageMessage.caption.startsWith(prefix) ? qul.message.imageMessage.caption : (type == 'videoMessage') && qul.message.videoMessage.caption.startsWith(prefix) ? qul.message.videoMessage.caption : (type == 'extendedTextMessage') && qul.message.extendedTextMessage.text.startsWith(prefix) ? qul.message.extendedTextMessage.text : ''
chats = (type === 'conversation') ? qul.message.conversation : (type === 'extendedTextMessage') ? qul.message.extendedTextMessage.text : ''
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const q = args.join(" ")
const arg = chats.slice(command.length + 2, chats.length)
const botNumber = xinz.user.jid
const isGroup = from.endsWith('@g.us')
const sender = qul.key.fromMe ? xinz.user.jid : isGroup ? qul.participant : qul.key.remoteJid
const totalchat = await xinz.chats.all()
const groupMetadata = isGroup ? await xinz.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupId = isGroup ? groupMetadata.jid : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupDesc = isGroup ? groupMetadata.desc : ''
const groupAdmins = isGroup ? aqul.getGroupAdmins(groupMembers) : ''
const groupOwner = isGroup ? groupMetadata.owner : ''
const itsMe = qul.key.fromMe ? true : false
const isUrl = (url) => {
return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%+.~#?&/=]*)/, 'gi'))
}
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
const isQuotedDocument = type === 'extendedTextMessage' && content.includes('documentMessage')
if (itsMe){
if (chats.toLowerCase() === `${prefix}self`){
public = false
aqul.sendFakeStatus(from, `Sukses`, `Status: SELF`)
}
if (chats.toLowerCase() === 'status'){
aqul.sendFakeStatus(from, `STATUS: ${public ? 'PUBLIC' : 'SELF'}`)
}/*
if (chats.startsWith('>')){
console.log(color('[EVAL]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`Eval brooo`))
return aqul.reply(from, JSON.stringify(eval(chats.slice(2)), null, 2), qul)
}*/
}
if (!public){
if (!qul.key.fromMe) return
}
if (isCmd && !isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`))}
if (isCmd && isGroup) {console.log(color('[CMD]'), color(moment(qul.messageTimestamp * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'from', color(xinz.user.name), 'in', color(groupName))}
switch (command) {
case 'menu': case 'help':
textnya = ` 𝐗𝐈𝐍𝐙-𝐒𝐄𝐋𝐅𝐁𝐎𝐓
\`\`\`▢ ${prefix}sticker\`\`\`
\`\`\`▢ ${prefix}swm nama | author\`\`\`
\`\`\`▢ ${prefix}takestick namma | author\`\`\`
\`\`\`▢ ${prefix}colong <reply stiker>\`\`\`
\`\`\`▢ ${prefix}eval <java scripts>\`\`\`
\`\`\`▢ ${prefix}self\`\`\`
\`\`\`▢ ${prefix}public\`\`\`
\`\`\`▢ ${prefix}hidetag\`\`\`
\`\`\`▢ ${prefix}runtime\`\`\`
\`\`\`▢ ${prefix}speed\`\`\`
\`\`\`▢ ${prefix}mystat\`\`\`
\`\`\`▢ ${prefix}kontak\`\`\`
\`\`\`▢ ${prefix}hidetag\`\`\`
\`\`\`▢ ${prefix}term\`\`\`
\`\`\`▢ ${prefix}setreply\`\`\`
\`\`\`▢ ${prefix}setprefix\`\`\`
\`\`\`▢ ${prefix}setname\`\`\`
\`\`\`▢ ${prefix}setpp\`\`\`
\`\`\`▢ ${prefix}setbio\`\`\`
\`\`\`▢ ${prefix}fdeface\`\`\`
\`\`\`▢ ${prefix}fakethumbnail\`\`\`
\`\`\`▢ ${prefix}setthumb\`\`\`
\`\`\`▢ ${prefix}getpic\`\`\`
\`\`\`▢ ${prefix}stickertag\`\`\`
\`\`\`▢ ${prefix}imgtag\`\`\`
\`\`\`▢ ${prefix}kontaktag\`\`\`
\`\`\`▢ ${prefix}doctag\`\`\`
\`\`\`▢ ${prefix}giftag\`\`\`
\`\`\`▢ ${prefix}tahta teks\`\`\`
\`\`\`▢ ${prefix}pubg teks1|teks2\`\`\`
\`\`\`▢ ${prefix}promote\`\`\`
\`\`\`▢ ${prefix}demote\`\`\`
\`\`\`▢ ${prefix}kick\`\`\`
\`\`\`▢ ${prefix}add\`\`\`
\`\`\`▢ ${prefix}creategrup nama|tag\`\`\`
\`\`\`▢ ${prefix}getgrup\`\`\`
\`\`\`▢ ${prefix}upstatus text\`\`\`
\`\`\`▢ ${prefix}tovideo\`\`\`
\`\`\`▢ ${prefix}togif\`\`\`
\`\`\`▢ ${prefix}spam teks|jumlah spam\`\`\`
\`\`\`▢ ${prefix}imgtourl\`\`\`
\`\`\`▢ ${prefix}ephemeral <teks>\`\`\`
\`\`\`▢ ${prefix}antidelete\`\`\`
\`\`\`▢ ${prefix}tourl <media>\`\`\`
*© Xinz-Team*`
aqul.sendFakeStatusWithImg(from, fakeimage, textnya, fake)
break
case 'test':
aqul.sendText(from, 'oke')
break
case 'public':
public = true
aqul.sendFakeStatus(from, `Status: PUBLIC`, fake)
break
case 'exif':
if (!itsMe) return
if (args.length < 1) return aqul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
if (!arg.split('|')) return aqul.reply(from, `Penggunaan ${prefix}exif nama|author`, qul)
exif.create(arg.split('|')[0], arg.split('|')[1])
aqul.reply(from, 'sukses', qul)
break
case 'sticker':
case 'stiker':
case 's':
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
await ffmpeg(`${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
aqul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
aqul.reply(from, mess.wait, qul)
await ffmpeg(`${media}`)
.inputFormat(media.split('.')[4])
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
tipe = media.endsWith('.mp4') ? 'video' : 'gif'
aqul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else {
aqul.reply(from, `Kirim gambar/video dengan caption ${prefix}sticker atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, qul)
}
break
case 'swm':
case 'stickerwm':
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
if (!arg.includes('|')) return aqul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname1 = arg.split('|')[0]
const author1 = arg.split('|')[1]
exif.create(packname1, author1, `stickwm_${sender}`)
await ffmpeg(`${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
aqul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else if ((isMedia && qul.message.videoMessage.fileLength < 10000000 || isQuotedVideo && qul.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.fileLength < 10000000)) {
if (!arg.includes('|')) return aqul.reply(from, `Kirim gambar atau reply gambar dengan caption *${prefix}stickerwm nama|author*`, qul)
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname1 = arg.split('|')[0]
const author1 = arg.split('|')[1]
exif.create(packname1, author1, `stickwm_${sender}`)
aqul.reply(from, mess.wait, qul)
await ffmpeg(`${media}`)
.inputFormat(media.split('.')[4])
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
tipe = media.endsWith('.mp4') ? 'video' : 'gif'
aqul.reply(from, mess.error.api, qul)
})
.on('end', function () {
console.log('Finish')
exec(`webpmux -set exif ./sticker/stickwm_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/${sender}.webp`)
fs.unlinkSync(`./sticker/stickwm_${sender}.exif`)
})
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(`./sticker/${sender}.webp`)
} else {
aqul.reply(from, `Kirim gambar/video dengan caption ${prefix}stickerwm nama|author atau tag gambar/video yang sudah dikirim\nNote : Durasi video maximal 10 detik`, id)
}
break
case 'takestick':
if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
const pembawm = body.slice(11)
if (!pembawm.includes('|')) return aqul.reply(from, `Reply sticker dengan caption *${prefix}takestick nama|author*`, qul)
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await xinz.downloadAndSaveMediaMessage(encmedia, `./sticker/${sender}`)
const packname = pembawm.split('|')[0]
const author = pembawm.split('|')[1]
exif.create(packname, author, `takestick_${sender}`)
exec(`webpmux -set exif ./sticker/takestick_${sender}.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(media)
fs.unlinkSync(`./sticker/takestick_${sender}.exif`)
})
break
case 'ephemeral'://DhyZx:v
if (!q) return aqul.reply(from, 'textnya apa brohh', qul)
xinz.sendMessage(from, `${q}`,
MessageType.text, {
sendEphemeral: true,
thumbnail: fs.readFileSync('./media/aqul.jpeg')
})
break
case 'colong':
if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}colong*`, qul)
const encmediia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const meidia = await xinz.downloadAndSaveMediaMessage(encmediia, `./sticker/${sender}`)
exec(`webpmux -set exif ./sticker/data.exif ./sticker/${sender}.webp -o ./sticker/${sender}.webp`, async (error) => {
if (error) return aqul.reply(from, mess.error.api, qul)
aqul.sendSticker(from, fs.readFileSync(`./sticker/${sender}.webp`), qul)
fs.unlinkSync(meidia)
})
break
case 'hidetag':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}hidetag teks`, qul)
aqul.hideTag(from, arg)
break
case 'runtime':
run = process.uptime()
let text = aqul.runtime(run)
aqul.sendFakeStatus(from, text, `Runtime bro`)
break
case 'speed': case 'ping':
let timestamp = speed();
let latensi = speed() - timestamp
aqul.sendFakeStatus(from, `Speed: ${latensi.toFixed(4)}second`, fake)
break
case 'mystat': case 'mystatus':
let i = []
let giid = []
for (mem of totalchat){
i.push(mem.jid)
}
for (id of i){
if (id && id.includes('g.us')){
giid.push(id)
}
}
let timestampi = speed();
let latensii = speed() - timestampi
const { wa_version, mcc, mnc, os_version, device_manufacturer, device_model } = xinz.user.phone
anu = process.uptime()
teskny = `*V. Whatsapp :* ${wa_version}
*Baterai :* ${baterai.baterai}%
*Charge :* ${baterai.cas === 'true' ? 'Ya' : 'Tidak'}
*RAM :* ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB / ${Math.round(require('os').totalmem / 1024 / 1024)}MB
*MCC :* ${mcc}
*MNC :* ${mnc}
*Versi OS :* ${os_version}
*Merk HP :* ${device_manufacturer}
*Versi HP :* ${device_model}
*Group Chat :* ${giid.length}
*Personal Chat :* ${totalchat.length - giid.length}
*Total Chat :* ${totalchat.length}
*Speed :* ${latensii.toFixed(4)} Second
*Runtime :* ${aqul.runtime(anu)}`
aqul.sendFakeStatus(from, teskny, fake)
break
case 'kontak':
argz = arg.split('|')
if (!argz) return aqul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
aqul.sendKontak(from, mentioned[0].split('@')[0], argz[1])
} else {
aqul.sendKontak(from, argz[0], argz[1])
}
break
case 'term':
if (!itsMe) return
if (!arg) return
exec(arg, (err, stdout) => {
if (err) return aqul.sendFakeStatus(from, err, fake)
if (stdout) aqul.sendFakeStatus(from, stdout, fake)
})
break
case 'setreply':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}setreply teks`, qul)
fake = arg
aqul.sendFakeStatus(from, `Sukses`, fake)
break
case 'setprefix':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}setprefix prefix`, qul)
prefix = arg
aqul.sendFakeStatus(from, `Prefix berhasil diubah menjadi ${prefix}`, fake)
break
case 'setname':
if (!itsMe) return
if (!arg) return aqul.reply(from, 'masukkan nama', qul)
aqul.setName(arg)
.then((res) => aqul.sendFakeStatus(from, JSON.stringify(res), fake))
.catch((err) => aqul.sendFakeStatus(from, JSON.stringify(err), fake))
break
case 'setbio':
if (!itsMe) return
if (!arg) return aqul.reply(from, 'masukkan bio', qul)
aqul.setBio(arg)
.then((res) => aqul.sendFakeStatus(from, JSON.stringify(res), fake))
.catch((err) => aqul.sendFakeStatus(from, JSON.stringify(err), fake))
break
case 'fdeface': case 'hack':
if (!arg) return aqul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By aqulzz|https://aqul.com`, qul)
argz = arg.split("|")
if (!argz) return aqul.reply(from, `Penggunaaan ${prefix}fdeface url|title|desc|url\n\nContoh : ${prefix}fdeface https://google.com|Self Bot|By aqulzz|https://aqul.com`, qul)
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await xinz.downloadMediaMessage(encmedia)
aqul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3], media)
} else {
aqul.sendFakeThumb(from, argz[0], argz[1], argz[2], argz[3])
}
break
case 'fakethumbnail': case 'fthumbnail': case 'fakethumb':
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await xinz.downloadMediaMessage(encmedia)
aqul.sendFakeImg(from, media, arg, fakeimage, qul)
} else {
aqul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}fakethumb caption`, qul)
}
break
case 'setthumb':
boij = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
delb = await xinz.downloadMediaMessage(boij)
fs.writeFileSync(`./media/aqul.jpeg`, delb)
fakeimage = fs.readFileSync(`./media/aqul.jpeg`)
aqul.sendFakeStatus(from, `Sukses`, fake)
break
case 'getpic':
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
try {
pic = await xinz.getProfilePicture(mentioned[0])
} catch {
pic = 'https://i.ibb.co/Tq7d7TZ/age-hananta-495-photo.png'
}
thumb = await aqul.getBuffer(pic)
aqul.sendImage(from, thumb)
}
break
case 'imgtag':
if ((isMedia && !qul.message.videoMessage || isQuotedImage)) {
let encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo : qul
let media = await xinz.downloadMediaMessage(encmedia)
aqul.hideTagImg(from, media)
} else {
aqul.reply(from, `Kirim gambar atau reply dengan caption ${prefix}imgtag caption`, qul)
}
break
case 'sticktag': case 'stickertag':
if (!isQuotedSticker) return aqul.reply(from, `Reply sticker dengan caption *${prefix}stickertag*`, qul)
let encmediai = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
let mediai = await xinz.downloadMediaMessage(encmediai)
aqul.hideTagSticker(from, mediai)
break
case 'kontaktag':
argz = arg.split('|')
if (!argz) return aqul.reply(from, `Penggunaan ${prefix}kontak @tag atau nomor|nama`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
aqul.hideTagKontak(from, mentioned[0].split('@')[0], argz[1])
} else {
aqul.hideTagKontak(from, argz[0], argz[1])
}
break
case 'doctag': case 'dokumentag': //by Dehanjing
if (!isQuotedDocument) return aqul.reply(from, `Reply Document dengan caption *${prefix + command}*`, qul)
quoted = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
download = await xinz.downloadMediaMessage(quoted)
await fs.writeFileSync(`doc.txt`, download)
var group = await xinz.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
xinz.sendMessage(from, fs.readFileSync(`doc.txt`), document, { contextInfo: {mentionedJid: mem }, quoted: qul, mimetype: 'text/plain' })
await fs.unlinkSync(`doc.txt`)
break
case 'giftag': case 'giphytag': //by Dehanjing
if (!isQuotedVideo) return reply(`Reply Gif nya dengan caption ${prefix + command}`)
quoted = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
download = await xinz.downloadMediaMessage(quoted)
await fs.writeFileSync(`giftag.gif`, download)
var group = await xinz.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
thumb = fs.readFileSync(`giftag.gif`)
xinz.sendMessage(from, thumb, video, { contextInfo: {mentionedJid: mem }, quoted: qul, mimetype: 'video/gif', thumbnail: thumb })
await fs.unlinkSync(`giftag.gif`)
break
case 'tahta':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}tahta teks`, qul)
aqul.sendMediaURL(from, `https://api.zeks.xyz/api/hartatahta?text=${arg}&apikey=apivinz`)
break
case 'pubg':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
argz = arg.split("|")
if (!argz) return aqul.reply(from, `Penggunaan ${prefix}pubg teks1|teks2`, qul)
axios.get(`https://xinzbot-api.herokuapp.com/api/textmaker/game?text=${argz[0]}&text2=${argz[1]}&theme=pubg&apikey=XinzBot`)
.then((res) => aqul.sendMediaURL(from, res.data.result.url))
.catch((err) => {
console.log(err)
aqul.reply(from, mess.error.api, qul)
})
break
case 'togif':
if (!isQuotedSticker) return reply(from, 'Reply stiker nya', qul)
if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await xinz.downloadAndSaveMediaMessage(encmedia)
const uploadn = await uptonaufal(media, Date.now() + '.webp')
const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
thumb = await aqul.getBuffer(anjj.data.result)
aqul.sendGif(from, thumb)
fs.unlinkSync(media)
} else {
aqul.reply(from, `Harus sticker bergerak`, qul)
}
break
case 'toimg': case 'tovideo':
if (!isQuotedSticker) return aqul.reply(from, 'Reply stiker nya', qul)
if (qul.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated === true){
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await xinz.downloadAndSaveMediaMessage(encmedia)
const uploadn = await uptonaufal(media, Date.now() + '.webp')
const anjj = await axios.get(`http://nzcha-apii.herokuapp.com/webp-to-mp4?url=${uploadn.result.image}`)
await aqul.sendMediaURL(from, anjj.data.result, 'Nih')
fs.unlinkSync(media)
} else {
const encmedia = JSON.parse(JSON.stringify(qul).replace('quotedM','m')).message.extendedTextMessage.contextInfo
const media = await xinz.downloadAndSaveMediaMessage(encmedia)
ran = aqul.getRandom('.png')
exec(`ffmpeg -i ${media} ${ran}`, (err) => {
fs.unlinkSync(media)
if (err) {
aqul.reply(from, `gagal`, qul)
fs.unlinkSync(ran)
} else {
buffer = fs.readFileSync(ran)
aqul.sendImage(from, buffer, 'nih', qul)
fs.unlinkSync(ran)
}
})
}
break
case 'shutdown':
await aqul.FakeTokoForwarded(from, `Bye...`, fake)
await aqul.sleep(5000)
xinz.close()
break
case 'spam':
if (!itsMe) return
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}spam teks|jumlahspam`, qul)
argz = arg.split("|")
if (!argz) return aqul.reply(from, `Penggunaan ${prefix}spam teks|jumlah`, qul)
if (isNaN(argz[1])) return aqul.reply(from, `harus berupa angka`, qul)
for (let i = 0; i < argz[1]; i++){
aqul.sendText(from, argz[0])
}
break
case 'promote':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}promote @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await aqul.FakeTokoForwarded(from, `sukses`, fake)
aqul.promote(from, mentioned)
} else {
await aqul.FakeTokoForwarded(from, `sukses`, fake)
aqul.promote(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'demote':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}demote @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await aqul.FakeTokoForwarded(from, `sukses`, fake)
aqul.demote(from, mentioned)
} else {
await aqul.FakeTokoForwarded(from, `sukses`, fake)
aqul.demote(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'kick':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}kick @tag atau nomor`, qul)
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
await aqul.FakeTokoForwarded(from, `Bye...`, fake)
aqul.kick(from, mentioned)
} else {
await aqul.FakeTokoForwarded(from, `Bye...`, fake)
aqul.kick(from, [args[0] + '@s.whatsapp.net'])
}
break
case 'add':
if (!arg) return aqul.reply(from, `Penggunaan ${prefix}kick 628xxxx`, qul)
aqul.add(from, [args[0] + '@s.whatsapp.net'])
aqul.FakeTokoForwarded(from, `Sukses`, fake)
break
case 'upstatus':
if (!itsMe) return
if (!arg) return aqul.reply(from, `Penggunaan \n${prefix}upstatus text\n${prefix}upstatus caption <reply atau kirim video / img>`, qul)
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia)
aqul.upImgStatus(media, arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
} else if ((isMedia || isQuotedVideo )) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadAndSaveMediaMessage(encmedia)
aqul.upVidStatus(media, arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
} else {
await aqul.upTextStatus(arg).then(() => { aqul.FakeTokoForwarded(from, 'Sukses', fake) })
}
break
case 'getgrup': case 'getgroup': case 'getg':
const ingfo = await aqul.getGroup(totalchat)
let txt = `Ingfo grup\nJumlah Grup: ${ingfo.length}\n\n`
for (let i = 0; i < ingfo.length; i++){
txt += `Nama grup : ${ingfo[i].subject}\nID grup : ${ingfo[i].id}\nDibuat : ${moment(`${ingfo[i].creation}` * 1000).tz('Asia/Jakarta').format('DD/MM/YYYY HH:mm:ss')}\nJumlah Peserta : ${ingfo[i].participants.length}\n\n`
}
aqul.FakeTokoForwarded(from, txt, fake)
break
case 'creategrup': case 'creategroup': case 'createg':
argz = arg.split('|')
if (qul.message.extendedTextMessage != undefined){
mentioned = qul.message.extendedTextMessage.contextInfo.mentionedJid
xinz.groupCreate(argz[0], mentioned)
.then((res) => aqul.FakeTokoForwarded(from, JSON.stringify(res, null, 2).toString(), fake))
.catch((err) => console.log(err))
} else {
aqul.reply(from, `Penggunaan ${prefix}creategrup namagrup|@tag`, qul)
}
break
case 'imgtourl':
const encmediiia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const mediaq = await xinz.downloadMediaMessage(encmediiia)
const upli = await uptotele(mediaq)
aqul.reply(from, `${upli}`, qul)
break
case 'tourl':
let a = JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo
let b = await xinz.downloadAndSaveMediaMessage(a)
let c = await uploadFile(b)
aqul.reply(from, c.result, qul)
fs.unlinkSync(b)
break
case 'antidelete':
if (!itsMe) return
const dataRevoke = JSON.parse(fs.readFileSync('./antidelete/gc-revoked.json'))
const dataCtRevoke = JSON.parse(fs.readFileSync('./antidelete/ct-revoked.json'))
const dataBanCtRevoke = JSON.parse(fs.readFileSync('./antidelete/ct-revoked-banlist.json'))
const isRevoke = dataRevoke.includes(from)
const isCtRevoke = dataCtRevoke.data
const isBanCtRevoke = dataBanCtRevoke.includes(sender) ? true : false
if (args.length === 0) return xinz.sendMessage(from, `Penggunaan fitur antidelete :\n\n*${prefix}antidelete [aktif/mati]* (Untuk grup)\n*${prefix}antidelete [ctaktif/ctmati]* (untuk semua kontak)\n*${prefix}antidelete banct 628558xxxxxxx* (banlist kontak)`, MessageType.text)
if (args[0] == 'aktif') {
if (isGroup) {
if (isRevoke) return xinz.sendMessage(from, `Antidelete telah diaktifkan di grup ini sebelumnya!`, MessageType.text)
dataRevoke.push(from)
fs.writeFileSync('./antidelete/gc-revoked.json', JSON.stringify(dataRevoke, null, 2))
xinz.sendMessage(from, `*Succes Enable Antidelete Grup!*`, MessageType.text)
} else if (!isGroup) {
xinz.sendMessage(from, `Untuk kontak penggunaan *${prefix}antidelete ctaktif*`, MessageType.text)
}
} else if (args[0] == 'ctaktif') {
if (!isGroup) {
if (isCtRevoke) return xinz.sendMessage(from, `Antidelete telah diaktifkan di semua kontak sebelumnya!`, MessageType.text)
dataCtRevoke.data = true
fs.writeFileSync('./antidelete/ct-revoked.json', JSON.stringify(dataCtRevoke, null, 2))
xinz.sendMessage(from, `Antidelete diaktifkan disemua kontak!`, MessageType.text)
} else if (isGroup) {
xinz.sendMessage(from, `Untuk grup penggunaan *${prefix}antidelete aktif*`, MessageType.text)
}
} else if (args[0] == 'banct') {
if (isBanCtRevoke) return xinz.sendMessage(from, `kontak ini telah ada di database banlist!`, MessageType.text)
if (args.length === 1 || args[1].startsWith('0')) return xinz.sendMessage(from, `Masukan nomer diawali dengan 62! contoh 62859289xxxxx`, MessageType.text)
dataBanCtRevoke.push(args[1] + '@s.whatsapp.net')
fs.writeFileSync('./antidelete/ct-revoked-banlist.json', JSON.stringify(dataBanCtRevoke, null, 2))
xinz.sendMessage(from, `Kontak ${args[1]} telah dimasukan ke banlist antidelete secara permanen!`, MessageType.text)
} else if (args[0] == 'mati') {
if (isGroup) {
const index = dataRevoke.indexOf(from)
dataRevoke.splice(index, 1)
fs.writeFileSync('./antidelete/gc-revoked.json', JSON.stringify(dataRevoke, null, 2))
xinz.sendMessage(from, `*Succes disable Antidelete Grup!*`, MessageType.text)
} else if (!isGroup) {
xinz.sendMessage(from, `Untuk kontak penggunaan *${prefix}antidelete ctmati*`, MessageType.text)
}
} else if (args[0] == 'ctmati') {
if (!isGroup) {
dataCtRevoke.data = false
fs.writeFileSync('./antidelete/ct-revoked.json', JSON.stringify(dataCtRevoke, null, 2))
xinz.sendMessage(from, `Antidelete dimatikan disemua kontak!`, MessageType.text)
} else if (isGroup) {
xinz.sendMessage(from, `Untuk grup penggunaan *${prefix}antidelete mati*`, MessageType.text)
}
}
break
case 'setpp': case 'setprofilepicture':
if (!itsMe) return
if (isMedia && !qul.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(qul).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : qul
const media = await xinz.downloadMediaMessage(encmedia)
xinz.updateProfilePicture(xinz.user.jid, media)
.then((res) => aqul.FakeTokoForwarded(from, JSON.stringify(res, null, 2).toString(), fake))
.catch((err) => console.log(err))
} else {
aqul.reply(from, `Kirim gambar atau reply gambar dengan caption ${prefix}setpp`, qul)
}
break
case 'eval':
if (!itsMe) return
let code = body.slice(6)
try {
if (!code) return aqul.reply(from, 'No JavaScript Code', qul)
let evaled;
if (code.includes("--silent") && code.includes("--async")) {
code = code.replace("--async", "").replace("--silent", "");
return await eval(`(async () => { ${code} })()`)
} else if (code.includes("--async")) {
code = code.replace("--async", "");
evaled = await eval(`(async () => { ${code} })()`);
} else if (code.includes("--silent")) {
code = code.replace("--silent", "");
return await eval(code);
} else evaled = await eval(code);
/*if (typeof evaled !== "string")
evaled = require("util").inspect(evaled, {
depth: 0
*/
let output = clean(evaled);
aqul.reply(from, JSON.stringify(evaled, null, 2), qul)
} catch (err) {
console.error(err)
const error = clean(err)
aqul.reply(from, error, qul)
}
function clean(text) {
if (typeof text === "string")
return text
.replace(/`/g, `\`${String.fromCharCode(8203)}`)
.replace(/@/g, `@${String.fromCharCode(8203)}`);
// eslint-disable-line prefer-template
else return text;
}
break
default:
break
}
} catch (err) {
console.log(color('[ERROR]', 'red'), err)
}
})