-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1087 lines (1062 loc) · 57.5 KB
/
index.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
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const {
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
waChatKey,
mentionedJid,
processTime,
} = require("@adiwajshing/baileys")
const qrcode = require("qrcode-terminal")
const moment = require("moment-timezone")
const fs = require("fs")
const crypto = require('crypto')
const { color, bgcolor } = require('./lib/color')
const { help } = require('./lib/help')
const { donasi } = require('./lib/donasi')
const { fetchJson } = require('./lib/fetcher')
const { recognize } = require('./lib/ocr')
const { exec } = require("child_process")
const { wait, simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('./lib/functions')
const tiktod = require('tiktok-scraper')
const ffmpeg = require('fluent-ffmpeg')
const cd = 4.32e+7
const { removeBackgroundFromImageFile } = require('remove.bg')
const { ind } = require('./language')
const vcard = 'BEGIN:VCARD\n'
+ 'VERSION:3.0\n'
+ 'FN:AgusAliansyah\n'
+ 'ORG: OwnerBot CIKA ;\n'
+ 'TEL;type=CELL;type=VOICE;waid=62895603272884:+62 895-6032-72884\n'
+ 'END:VCARD'
prefix = '#'
blocked = []
/*********** LOAD FILE ***********/
const _leveling = JSON.parse(fs.readFileSync('./database/group/leveling.json'))
const _level = JSON.parse(fs.readFileSync('./database/user/level.json'))
const _registered = JSON.parse(fs.readFileSync('./database/bot/registered.json'))
const welkom = JSON.parse(fs.readFileSync('./database/bot/welkom.json'))
const nsfw = JSON.parse(fs.readFileSync('./database/bot/nsfw.json'))
const samih = JSON.parse(fs.readFileSync('./database/bot/simi.json'))
/*********** END LOAD ***********/
/*********** DATABASE LEVEL********/
aha = 1
ahb = 2
ahc = 3
ahd = 4
ahe = 5
ahf = 10
/*********** DATABASE LEVEL********/
/********** FUNCTION ***************/
const getLevelingXp = (sender) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].id === sender) {
position = i
}
})
if (position !== false) {
return _level[position].xp
}
}
const getLevelingLevel = (sender) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].id === sender) {
position = i
}
})
if (position !== false) {
return _level[position].level
}
}
const getLevelingId = (sender) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].id === sender) {
position = i
}
})
if (position !== false) {
return _level[position].jid
}
}
const addLevelingXp = (sender, amount) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].id === sender) {
position = i
}
})
if (position !== false) {
_level[position].xp += amount
fs.writeFileSync('./database/user/level.json', JSON.stringify(_level))
}
}
const addLevelingLevel = (sender, amount) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].id === sender) {
position = i
}
})
if (position !== false) {
_level[position].level += amount
fs.writeFileSync('./database/user/level.json', JSON.stringify(_level))
}
}
const addLevelingId = (sender) => {
const obj = {id: sender, xp: 1, level: 1}
_level.push(obj)
fs.writeFileSync('./database/user/level.json', JSON.stringify(_level))
}
const getRegisteredRandomId = () => {
return _registered[Math.floor(Math.random() * _registered.length)].id
}
const addRegisteredUser = (userid, sender, age, time, serials) => {
const obj = { id: userid, name: sender, age: age, time: time, serial: serials }
_registered.push(obj)
fs.writeFileSync('./database/bot/registered.json', JSON.stringify(_registered))
}
const createSerial = (size) => {
return crypto.randomBytes(size).toString('hex').slice(0, size)
}
const checkRegisteredUser = (sender) => {
let status = false
Object.keys(_registered).forEach((i) => {
if (_registered[i].id === sender) {
status = true
}
})
return status
}
function kyun(seconds){
function pad(s){
return (s < 10 ? '0' : '') + s;
}
var hours = Math.floor(seconds / (60*60));
var minutes = Math.floor(seconds % (60*60) / 60);
var seconds = Math.floor(seconds % 60);
//return pad(hours) + ':' + pad(minutes) + ':' + pad(seconds)
return `${pad(hours)} Jam ${pad(minutes)} Menit ${pad(seconds)} Detik`
}
/********** FUNCTION ***************/
const client = new WAConnection()
client.on('qr', qr => {
qrcode.generate(qr, { small: true })
console.log(color('[','white'),color('∆','red'),color(']','white'),color('qr already scan.author by','white'),color('Agus','red'),color('Aliansyah','white'),color('CIKA&VVIPBOT','yellow'))
})
client.on('credentials-updated', () => {
const authInfo = client.base64EncodedAuthInfo()
console.log(`credentials updated!`)
fs.writeFileSync('./session.json', JSON.stringify(authInfo, null, '\t'))
})
fs.existsSync('./session.json') && client.loadAuthInfo('./session.json')
client.connect();
client.on('group-participants-update', async (anu) => {
if (!welkom.includes(anu.jid)) return
try {
const mdata = await client.groupMetadata(anu.jid)
console.log(anu)
if (anu.action == 'add') {
num = anu.participants[0]
try {
ppimg = await client.getProfilePicture(`${anu.participants[0].split('@')[0]}@c.us`)
} catch {
ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'
}
teks = `Hallo @${num.split('@')[0]}\Selamat datang di group *${mdata.subject}* yang betah ya di sini`
let buff = await getBuffer(ppimg)
client.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
} else if (anu.action == 'remove') {
num = anu.participants[0]
try {
ppimg = await client.getProfilePicture(`${num.split('@')[0]}@c.us`)
} catch {
ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'
}
teks = `akhirnya beban group berkurang 𝟭,bye bye🥳 @${num.split('@')[0]} jasamu akan di kubur dalam²`
let buff = await getBuffer(ppimg)
client.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
}
} catch (e) {
console.log('Error : %s', color(e, 'red'))
}
})
client.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'))
}
})
client.on('message-new', async (mek) => {
try {
if (!mek.message) return
if (mek.key && mek.key.remoteJid == 'status@broadcast') return
if (mek.key.fromMe) return
global.prefix
global.blocked
const content = JSON.stringify(mek.message)
const from = mek.key.remoteJid
const type = Object.keys(mek.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')
const timu = moment(time * 1000).format('DD/MM/YYYY');
const timi = moment(time * 1000).add(30, 'days').calendar();
body = (type === 'conversation' && mek.message.conversation.startsWith(prefix)) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption.startsWith(prefix) ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption.startsWith(prefix) ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text.startsWith(prefix) ? mek.message.extendedTextMessage.text : ''
budy = (type === 'conversation') ? mek.message.conversation : (type === 'extendedTextMessage') ? mek.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 botNumber = client.user.jid
const ownerNumber = ["62895603272884@s.whatsapp.net"]
const isGroup = from.endsWith('@g.us')
const sender = isGroup ? mek.participant : mek.key.remoteJid
pushname = client.contacts[sender] != undefined ? client.contacts[sender].vname || client.contacts[sender].notify : undefined
const groupMetadata = isGroup ? await client.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 ? getGroupAdmins(groupMembers) : ''
const isRegistered = checkRegisteredUser(sender)
const isBotGroupAdmins = groupAdmins.includes(botNumber) || false
const isLevelingOn = isGroup ? _leveling.includes(groupId) : false
const isGroupAdmins = groupAdmins.includes(sender) || false
const isWelkom = isGroup ? welkom.includes(from) : false
const isNsfw = isGroup ? nsfw.includes(from) : false
const isSimi = isGroup ? samih.includes(from) : false
const isOwner = ownerNumber.includes(sender)
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 reply = (teks) => {
client.sendMessage(from, teks, text, {quoted:mek})
}
const sendMess = (hehe, teks) => {
client.sendMessage(hehe, teks, text)
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? client.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : client.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": memberr}})
}
//function leveling
if (isGroup && isRegistered && isLevelingOn) {
const currentLevel = getLevelingLevel(sender)
const checkId = getLevelingId(sender)
try {
if (currentLevel === undefined && checkId === undefined) addLevelingId(sender)
const amountXp = Math.floor(Math.random() * 10) + 500
const requiredXp = 5000 * (Math.pow(2, currentLevel) - 1)
const getLevel = getLevelingLevel(sender)
addLevelingXp(sender, amountXp)
if (requiredXp <= getLevelingXp(sender)) {
addLevelingLevel(sender, 1)
await reply(`*「 LEVEL UP 」*\n\n➸ *Nama* : ${pushname}\n➸ *Nomer*: wa.me/${sender.split("@")[0]}\n➸ *XP*: ${getLevelingXp(sender)}\n➸ *Level*: ${getLevel} -> ${getLevelingLevel(sender)}\n\nCongrats!! 🎉🎉`)
}
} catch (err) {
console.error(err)
}
}
colors = ['red','white','black','blue','yellow','green']
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
if (!isGroup && isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(command), 'from', color(sender.split('@')[0]), 'args :', color(args.length))
if (!isGroup && !isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mRECV\x1b[1;37m]', time, color('Message'), 'from', color(sender.split('@')[0]), 'args :', color(args.length))
if (isCmd && isGroup) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(command), 'from', color(sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length))
if (!isCmd && isGroup) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mRECV\x1b[1;37m]', time, color('Message'), 'from', color(sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length))
switch(command) {
case 'daftar':
if (isRegistered) return reply(ind.rediregis())
if (!q.includes('|')) return reply(ind.wrongf())
const namaUser = q.substring(0, q.indexOf('|') - 0)
const umurUser = q.substring(q.lastIndexOf('|') + 1)
const serialUser = createSerial(20)
veri = sender
if (isGroup) {
addRegisteredUser(sender, namaUser, umurUser, time, serialUser)
await reply(ind.registered(namaUser, umurUser, serialUser, time, sender))
console.log(color('[REGISTER]'), color(time, 'yellow'), 'Name:', color(namaUser, 'cyan'), 'Age:', color(umurUser, 'cyan'), 'Serial:', color(serialUser, 'cyan'), 'in', color(sender || groupName))
} else {
addRegisteredUser(sender, namaUser, umurUser, time, serialUser)
await reply(ind.registered(namaUser, umurUser, serialUser, time, sender))
console.log(color('[REGISTER]'), color(time, 'yellow'), 'Name:', color(namaUser, 'cyan'), 'Age:', color(umurUser, 'cyan'), 'Serial:', color(serialUser, 'cyan'))
}
break
case 'bisakah':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahf ) return reply(ind.reglevelahf(command, pushname, getLevelingLevel, sender, ahf))
bisakah = body.slice(1)
const bisa =['Bisa','Tidak Bisa','Coba Ulangi']
const keh = bisa[Math.floor(Math.random() * bisa.length)]
client.sendMessage(from, 'Pertanyaan : *'+bisakah+'*\n\nJawaban : '+ keh, text, { quoted: mek })
break
case 'kapankah':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahf ) return reply(ind.reglevelahf(command, pushname, getLevelingLevel, sender, ahf))
kapankah = body.slice(1)
const kapan =['Besok','Lusa','Tadi','4 Hari Lagi','5 Hari Lagi','6 Hari Lagi','1 Minggu Lagi','2 Minggu Lagi','3 Minggu Lagi','1 Bulan Lagi','2 Bulan Lagi','3 Bulan Lagi','4 Bulan Lagi','5 Bulan Lagi','6 Bulan Lagi','1 Tahun Lagi','2 Tahun Lagi','3 Tahun Lagi','4 Tahun Lagi','5 Tahun Lagi','6 Tahun Lagi','1 Abad lagi','3 Hari Lagi']
const koh = kapan[Math.floor(Math.random() * kapan.length)]
client.sendMessage(from, 'Pertanyaan : *'+kapankah+'*\n\nJawaban : '+ koh, text, { quoted: mek })
break
case 'apakah':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahf ) return reply(ind.reglevelahf(command, pushname, getLevelingLevel, sender, ahf))
apakah = body.slice(1)
const apa =['Iya','Tidak','Bisa Jadi','Coba Ulangi']
const kah = apa[Math.floor(Math.random() * apa.length)]
client.sendMessage(from, 'Pertanyaan : *'+apakah+'*\n\nJawaban : '+ kah, text, { quoted: mek })
break
case 'rate':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahf ) return reply(ind.reglevelahf(command, pushname, getLevelingLevel, sender, ahf))
rate = body.slice(1)
const ra =['4','9','17','28','34','48','59','62','74','83','97','100','29','94','75','82','41','39']
const te = ra[Math.floor(Math.random() * ra.length)]
client.sendMessage(from, 'Pertanyaan : *'+rate+'*\n\nJawaban : '+ te+'%', text, { quoted: mek })
break
case 'speed':
case 'ping':
if (!isRegistered) return reply(ind.noregis())
await client.sendMessage(from, `Pong!!!!\nSpeed: ${processTime(time, moment())} _Second_`)
break
case 'help':
case 'menu':
if (!isRegistered) return reply(ind.noregis())
const reqXp = 5000 * (Math.pow(2, getLevelingLevel(sender)) - 1)
client.sendMessage(from, help(pushname, prefix, getLevelingLevel, getLevelingXp, sender, reqXp), text)
break
case 'donasi':
case 'donate':
if (!isRegistered) return reply(ind.noregis())
client.sendMessage(from, donasi(), text)
break
case 'level':
if (!isRegistered) return reply(ind.noregis())
if (!isLevelingOn) return reply(ind.lvlnoon())
if (!isGroup) return reply(ind.groupo())
const userLevel = getLevelingLevel(sender)
const userXp = getLevelingXp(sender)
if (userLevel === undefined && userXp === undefined) return reply(ind.lvlnul())
const requiredXp = 5000 * (Math.pow(2, userLevel) - 1)
resul = `┏━━❉ *LEVEL* ❉━━\n┣⊱ *Nama* : ${pushname}\n┣⊱ Nomor : wa.me/${sender.split("@")[0]}\n┣⊱ User XP : ${userXp}/${requiredXp}\n┣⊱ User Level : ${userLevel}\n┗━━━━━━━━━━━━`
client.sendMessage(from, resul, text, { quoted: mek})
.catch(async (err) => {
console.error(err)
await reply(`Error!\n${err}`)
})
break
case 'info':
me = client.user
uptime = process.uptime()
teks = `*Nama bot* : ${me.name}\n*OWNER* : *CIKA*\n*AUTHOR* : CIKA\n*Nomor Bot* : @${me.jid.split('@')[0]}\n*Prefix* : ${prefix}\n*Total Block Contact* : ${blocked.length}\n*The bot is active on* : ${kyun(uptime)}`
buffer = await getBuffer(me.imgUrl)
client.sendMessage(from, buffer, image, {caption: teks, contextInfo:{mentionedJid: [me.jid]}})
break
case 'blocklist':
teks = '𝗕𝗟𝗢𝗖𝗞 𝗟𝗜𝗦𝗧 :\n'
for (let block of blocked) {
teks += `┣➢ @${block.split('@')[0]}\n`
}
teks += `𝗧𝗼𝘁𝗮𝗹 : ${blocked.length}`
client.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": blocked}})
break
case 'hidetag':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
var value = body.slice(9)
var group = await client.groupMetadata(from)
var member = group['participants']
var mem = []
member.map( async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
text: value,
contextInfo: { mentionedJid: mem },
quoted: mek
}
client.sendMessage(from, options, text)
break
case 'quotemaker':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
var gh = body.slice(12)
var quote = gh.split("|")[0];
var wm = gh.split("|")[1];
var bg = gh.split("|")[2];
const pref = `Usage: \n${prefix}quotemaker teks|watermark|theme\n\nEx :\n${prefix}quotemaker ini contoh|bicit|random`
if (args.length < 1) return reply(pref)
reply(ind.wait())
anu = await fetchJson(`https://terhambar.com/aw/qts/?kata=${quote}&author=${wm}&tipe=${bg}`, {method: 'get'})
buffer = await getBuffer(anu.result)
client.sendMessage(from, buffer, image, {caption: 'Nih anjim', quoted: mek})
break
case 'phlogo':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahe ) return reply(ind.reglevelahe(command, pushname, getLevelingLevel, sender, ahe))
var gh = body.slice(9)
var gbl1 = gh.split("|")[0];
var gbl2 = gh.split("|")[1];
if (args.length < 1) return reply('Teksnya mana um')
reply(ind.wait())
anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/textpro?theme=pornhub&text1=${gbl1}&text2=${gbl2}`, {method: 'get'})
buffer = await getBuffer(anu.result)
client.sendMessage(from, buffer, image, {quoted: mek})
break
/* case 'kickme':
* if (isGroupAdmins) return reply(`maaf ${pushname} saya tidak bisa mengeluarkan admin`)
* reply(`Kenapa ${pushname} keluar?\nbaiklah kalau itu mau mu\nbye bye`)
* await client.groupRemove(groupId, sender)
break*/
case 'truth':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
const trut =['Pernah suka sama siapa aja? berapa lama?','Kalau boleh atau kalau mau, di gc/luar gc siapa yang akan kamu jadikan sahabat?(boleh beda/sma jenis)','apa ketakutan terbesar kamu?','pernah suka sama orang dan merasa orang itu suka sama kamu juga?','Siapa nama mantan pacar teman mu yang pernah kamu sukai diam diam?','pernah gak nyuri uang nyokap atau bokap? Alesanya?','hal yang bikin seneng pas lu lagi sedih apa','pernah cinta bertepuk sebelah tangan? kalo pernah sama siapa? rasanya gimana brou?','pernah jadi selingkuhan orang?','hal yang paling ditakutin','siapa orang yang paling berpengaruh kepada kehidupanmu','hal membanggakan apa yang kamu dapatkan di tahun ini','siapa orang yang bisa membuatmu sange','siapa orang yang pernah buatmu sange','(bgi yg muslim) pernah ga solat seharian?','Siapa yang paling mendekati tipe pasangan idealmu di sini','suka mabar(main bareng)sama siapa?','pernah nolak orang? alasannya kenapa?','Sebutkan kejadian yang bikin kamu sakit hati yang masih di inget','pencapaian yang udah didapet apa aja ditahun ini?','kebiasaan terburuk lo pas di sekolah apa?']
const ttrth = trut[Math.floor(Math.random() * trut.length)]
truteh = await getBuffer(`https://i.ibb.co/305yt26/bf84f20635dedd5dde31e7e5b6983ae9.jpg`)
client.sendMessage(from, truteh, image, { caption: '*Truth*\n\n'+ ttrth, quoted: mek })
break
case 'dare':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
const dare =['Kirim pesan ke mantan kamu dan bilang "aku masih suka sama kamu','telfon crush/pacar sekarang dan ss ke pemain','pap ke salah satu anggota grup','Bilang "KAMU CANTIK BANGET NGGAK BOHONG" ke cowo','ss recent call whatsapp','drop emot "🦄💨" setiap ngetik di gc/pc selama 1 hari','kirim voice note bilang can i call u baby?','drop kutipan lagu/quote, terus tag member yang cocok buat kutipan itu','pake foto sule sampe 3 hari','ketik pake bahasa daerah 24 jam','ganti nama menjadi "gue anak lucinta luna" selama 5 jam','chat ke kontak wa urutan sesuai %batre kamu, terus bilang ke dia "i lucky to hv you','prank chat mantan dan bilang " i love u, pgn balikan','record voice baca surah al-kautsar','bilang "i hv crush on you, mau jadi pacarku gak?" ke lawan jenis yang terakhir bgt kamu chat (serah di wa/tele), tunggu dia bales, kalo udah ss drop ke sini','sebutkan tipe pacar mu!','snap/post foto pacar/crush','teriak gajelas lalu kirim pake vn kesini','pap mukamu lalu kirim ke salah satu temanmu','kirim fotomu dengan caption, aku anak pungut','teriak pake kata kasar sambil vn trus kirim kesini','teriak " anjimm gabutt anjimmm " di depan rumah mu','ganti nama jadi " BOWO " selama 24 jam','Pura pura kerasukan, contoh : kerasukan maung, kerasukan belalang, kerasukan kulkas, dll']
const der = dare[Math.floor(Math.random() * dare.length)]
tod = await getBuffer(`https://i.ibb.co/305yt26/bf84f20635dedd5dde31e7e5b6983ae9.jpg`)
client.sendMessage(from, tod, image, { quoted: mek, caption: '*Dare*\n\n'+ der })
break
case 'waifu':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
anu = await fetchJson(`https://arugaz.herokuapp.com/api/waifu`)
buf = await getBuffer(anu.image)
texs = ` *anime name* : ${anu.name} \n*deskripsi* : ${anu.desc} \n*source* : ${anu.source}`
client.sendMessage(from, buf, image, { quoted: mek, caption: `${texs}` })
break
case 'anime':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
teks = body.slice(7)
anu = await fetchJson(`https://mnazria.herokuapp.com/api/anime?query=${teks}`, {method: 'get'})
reply('anime nya ni '+teks+' adalah :\n\n'+anu.title)
break
case 'neko':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
anu = await fetchJson(`https://arugaz.herokuapp.com/api/nekonime` , {method: 'get'})
buf = await getBuffer(anu.result)
client.sendMessage(from, buf, image, { quoted: mek, caption: 'ih wibu'})
break
case 'dewabatch':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
teks = body.slice(11)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/dewabatch?q=${teks}` , {method: 'get'})
thum = await getBuffer(anu.thumb)
client.sendMessage(from, thum, image, {quoted: mek, caption: `${anu.result}`})
break
case 'ssweb':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahc ) return reply(ind.reglevelahc(command, pushname, getLevelingLevel, sender, ahc))
if (args.length < 1) return reply('Urlnya mana om')
teks = body.slice(7)
reply(ind.wait())
anu = await fetchJson(`https://mnazria.herokuapp.com/api/screenshotweb?url=${teks}`)
buff = await getBuffer(anu.gambar)
client.sendMessage(from, buff, image, {quoted: mek})
break
case 'bucin':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahc ) return reply(ind.reglevelahc(command, pushname, getLevelingLevel, sender, ahc))
gatauda = body.slice(7)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/howbucins`, {method: 'get'})
reply(anu.desc)
break
case 'persengay':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahc ) return reply(ind.reglevel(command, pushname, getLevelingLevel, sender, ahc))
gatauda = body.slice(11)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/howbucins`, {method: 'get'})
reply(anu.desc+anu.persen)
break
case 'quotes':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
gatauda = body.slice(8)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/randomquotes`, {method: 'get'})
reply(anu.quotes)
break
case 'cerpen':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
gatauda = body.slice(8)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/cerpen`, {method: 'get'})
reply(anu.result.result)
break
case 'chord':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahe ) return reply(ind.reglevelahe(command, pushname, getLevelingLevel, sender, ahe))
if (args.length < 1) return reply('teks nya mana om')
tels = body.slice(7)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/chord?q=${tels}`, {method: 'get'})
reply(anu.result)
break
case 'lirik':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahe ) return reply(ind.reglevelahe(command, pushname, getLevelingLevel, sender, ahe))
if (args.length < 1) return reply('judul lagu nya mana om')
teha = body.slice(7)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/lirik?judul=${teha}` , {method: 'get'})
reply(anu.result)
break
case 'pokemon':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
anu = await fetchJson(`https://api.fdci.se/rep.php?gambar=pokemon`, {method: 'get'})
reply(ind.wait())
var n = JSON.parse(JSON.stringify(anu));
var nimek = n[Math.floor(Math.random() * n.length)];
pok = await getBuffer(nimek)
client.sendMessage(from, pok, image, { quoted: mek })
break
case 'anjing':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
anu = await fetchJson(`https://api.fdci.se/rep.php?gambar=anjing`, {method: 'get'})
reply(ind.wait())
var n = JSON.parse(JSON.stringify(anu));
var nimek = n[Math.floor(Math.random() * n.length)];
pok = await getBuffer(nimek)
client.sendMessage(from, pok, image, { quoted: mek })
break
case 'spamcall':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
if (args.length < 1) return ('masukan nomer tujuan bambang')
weha = body.slice(10)
anu = await fetchJson(`https://arugaz.herokuapp.com/api/spamcall?no=${weha}` , {method: 'get'})
client.sendMessage(from, anu.logs, text, {quoted: mek})
break
case 'indohot':
if (!isRegistered) return reply(ind.noregis())
if (!isGroup) return reply(ind.groupo())
if (!isNsfw) return reply(ind.nsfwoff())
anu = await fetchJson(`https://arugaz.herokuapp.com/api/indohot`, {method: 'get'})
if (anu.error) return reply(anu.error)
hasil = `*judul* ${anu.result.judul} \n*genre* ${anu.result.genre} \n*durasi* ${anu.result.durasi} \n*url* ${anu.result.url}`
client.sendMessage(from, hasil, text, {quoted: mek})
break
case 'ytmp4':
if (!isRegistered) return reply(ind.noregis())
if (args.length < 1) return reply('Urlnya mana um?')
if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(ind.stikga())
anu = await fetchJson(`https://st4rz.herokuapp.com/api/ytv2?url=${args[0]}`, {method: 'get'})
if (anu.error) return reply(anu.error)
teks = `*Title* : ${anu.title}`
thumb = await getBuffer(anu.thumb)
client.sendMessage(from, thumb, image, {quoted: mek, caption: teks})
buffer = await getBuffer(anu.result)
client.sendMessage(from, buffer, video, {mimetype: 'video/mp4', filename: `${anu.title}.mp4`, quoted: mek})
break
case 'text3d':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahc ) return reply(ind.reglevelahc(command, pushname, getLevelingLevel, sender, ahc))
if (args.length < 1) return reply('teksnya mana kak?')
teks = `${body.slice(8)}`
if (teks.length > 10) return client.sendMessage(from, 'Teksnya kepanjangan, Maksimal 10 kalimat', text, {quoted: mek})
buff = await getBuffer(`https://docs-jojo.herokuapp.com/api/text3d?text=${teks}`, {method: 'get'})
client.sendMessage(from, buff, image, {quoted: mek, caption: `${teks}`})
break
case 'fototiktok':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
gatauda = body.slice(12)
anu = await fetchJson(`https://docs-jojo.herokuapp.com/api/tiktokpp?user=${gatauda}`)
buff = await getBuffer(anu.result)
reply(anu.result)
break
case 'map':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
anu = await fetchJson(`https://mnazria.herokuapp.com/api/maps?search=${body.slice(5)}`, {method: 'get'})
buffer = await getBuffer(anu.gambar)
client.sendMessage(from, buffer, image, {quoted: mek, caption: `${body.slice(5)}`})
break
case 'kbbi':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
if (args.length < 1) return reply('Apa yang mau dicari um?')
anu = await fetchJson(`https://mnazria.herokuapp.com/api/kbbi?search=${body.slice(6)}`, {method: 'get'})
reply('Menurut Kbbi:\n\n'+anu.result)
break
case 'artinama':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahd ) return reply(ind.reglevelahd(command, pushname, getLevelingLevel, sender, ahd))
if (args.length < 1) return reply('Apa yang mau dicari um?')
anu = await fetchJson(`https://mnazria.herokuapp.com/api/arti?nama=${body.slice(10)}`, {method: 'get'})
reply('Menurut nama:\n\n'+anu.result)
break
case 'ocr':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
const media = await client.downloadAndSaveMediaMessage(encmedia)
reply(ind.wait())
await recognize(media, {lang: 'eng+ind', oem: 1, psm: 3})
.then(teks => {
reply(teks.trim())
fs.unlinkSync(media)
})
.catch(err => {
reply(err.message)
fs.unlinkSync(media)
})
} else {
reply('𝗸𝗶𝗿𝗶𝗺 𝗳𝗼𝘁𝗼 𝗱𝗲𝗻𝗴𝗮𝗻 𝗰𝗲𝗽𝘁𝗶𝗼𝗻 ${prefix}𝗼𝗰𝗿')
}
break
case 'stiker':
case 'sticker':
case 's':
if (getLevelingLevel(sender) < aha ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, aha))
if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
const media = await client.downloadAndSaveMediaMessage(encmedia)
ran = getRandom('.webp')
await ffmpeg(`./${media}`)
.input(media)
.on('start', function (cmd) {
console.log(`Started : ${cmd}`)
})
.on('error', function (err) {
console.log(`Error : ${err}`)
fs.unlinkSync(media)
reply(mess.error.stick)
})
.on('end', function () {
console.log('Finish')
buff = fs.readFileSync(ran)
client.sendMessage(from, buff, sticker, {quoted: mek})
fs.unlinkSync(media)
fs.unlinkSync(ran)
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
} else if ((isMedia && mek.message.videoMessage.seconds < 11 || isQuotedVideo && mek.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.seconds < 11) && args.length == 0) {
const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
const media = await client.downloadAndSaveMediaMessage(encmedia)
ran = getRandom('.webp')
reply(ind.wait())
await ffmpeg(`./${media}`)
.inputFormat(media.split('.')[1])
.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'
reply(`Yah gagal, coba ulangi ^_^`)
})
.on('end', function () {
console.log('Finish')
buff = fs.readFileSync(ran)
client.sendMessage(from, buff, sticker, {quoted: mek})
fs.unlinkSync(media)
fs.unlinkSync(ran)
})
.addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
} else {
reply(`Kirim gambar dengan caption ${prefix}sticker atau reply/tag gambar`)
}
break
case 'tts':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
if (args.length < 1) return client.sendMessage(from, 'Diperlukan kode bahasa!!', text, {quoted: mek})
const gtts = require('./lib/gtts')(args[0])
if (args.length < 2) return client.sendMessage(from, 'Mana teks yang ma di jadiin suara? suara saya kah:v?', text, {quoted: mek})
dtt = body.slice(9)
ranm = getRandom('.mp3')
rano = getRandom('.ogg')
dtt.length > 300
? reply('lah teks nya kepanjangan bambang😤')
: gtts.save(ranm, dtt, function() {
exec(`ffmpeg -i ${ranm} -ar 48000 -vn -c:a libopus ${rano}`, (err) => {
fs.unlinkSync(ranm)
buff = fs.readFileSync(rano)
if (err) return reply(ind.stikga())
client.sendMessage(from, buff, audio, {quoted: mek, ptt:true})
fs.unlinkSync(rano)
})
})
break
case 'setprefix':
if (args.length < 1) return
if (!isOwner) return reply(ind.ownerb())
prefix = args[0]
reply(`𝗣𝗿𝗲𝗳𝗶𝘅 𝗯𝗲𝗿𝗵𝗮𝘀𝗶𝗹 𝗱𝗶 𝘂𝗯𝗮𝗵 𝗺𝗲𝗻𝗷𝗮𝗱𝗶 : ${prefix}`)
break
case 'hilih':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahc ) return reply(ind.reglevel(command, pushname, getLevelingLevel, sender, ahc))
if (args.length < 1) return reply('kasih teks lah^_^!!!')
anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/hilih?teks=${body.slice(7)}`, {method: 'get'})
reply(anu.result)
break
case 'tiktokstalk':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
try {
if (args.length < 1) return client.sendMessage(from, '𝘂𝘀𝗲𝗿𝗻𝗮𝗺𝗲 𝗺𝗮𝗻𝗮 ?', text, {quoted: mek})
let { user, stats } = await tiktod.getUserProfileInfo(args[0])
reply(ind.wait())
teks = `*ID* : ${user.id}\n*Username* : ${user.uniqueId}\n*Nickname* : ${user.nickname}\n*Followers* : ${stats.followerCount}\n*Followings* : ${stats.followingCount}\n*Posts* : ${stats.videoCount}\n*Luv* : ${stats.heart}\n`
buffer = await getBuffer(user.avatarLarger)
client.sendMessage(from, buffer, image, {quoted: mek, caption: teks})
} catch (e) {
console.log(`Error :`, color(e,'red'))
reply('[𝗘𝗥𝗥𝗢𝗥] 𝗸𝗲𝗺𝘂𝗻𝗴𝗸𝗶𝗻𝗮𝗻 𝘂𝘀𝗲𝗿𝗻𝗮𝗺𝗲 𝘁𝗶𝗱𝗮𝗸 𝘃𝗮𝗹𝗶𝗱')
}
break
case 'linkgc':
if (!isGroup) return reply(ind.groupo())
if (!isBotGroupAdmins) return reply(ind.badmin())
linkgc = await client.groupInviteCode (from)
yeh = `https://chat.whatsapp.com/${linkgc}\n\nlink Group *${groupName}*`
client.sendMessage(from, yeh, text, {quoted: mek})
break
case 'tagall':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
members_id = []
teks = (args.length > 1) ? body.slice(8).trim() : ''
teks += '\n\n'
for (let mem of groupMembers) {
teks += `┣➥ @${mem.jid.split('@')[0]}\n`
members_id.push(mem.jid)
}
mentions(teks, members_id, true)
break
case 'clearall':
if (!isOwner) return reply(ind.ownerb())
anu = await client.chats.all()
client.setMaxListeners(25)
for (let _ of anu) {
client.deleteChat(_.jid)
}
reply(ind.clears())
break
case 'block':
client.updatePresence(from, Presence.composing)
client.chatRead (from)
if (!isGroup) return reply(ind.groupo())
if (!isOwner) return reply(ind.ownerb())
client.blockUser (`${body.slice(7)}@c.us`, "add")
client.sendMessage(from, `perintah Diterima, memblokir ${body.slice(7)}@c.us`, text)
break
case 'unblock':
if (!isGroup) return reply(ind.groupo())
if (!isOwner) return reply(ind.ownerb())
client.blockUser (`${body.slice(9)}@c.us`, "remove")
client.sendMessage(from, `𝗽𝗲𝗿𝗶𝗻𝘁𝗮𝗵 𝗗𝗶𝘁𝗲𝗿𝗶𝗺𝗮, 𝗺𝗲𝗺𝗯𝘂𝗸𝗮 ${body.slice(9)}@c.us`, text)
break
case 'leave':
if (!isGroup) return reply(ind.groupo())
if (!isOwner) return reply(ind.ownerb())
await reply(dari, 'bye').then(() => client.leaveGroup(groupId))
break
case 'bc':
if (!isOwner) return reply(ind.ownerb())
if (args.length < 1) return reply('.......')
anu = await client.chats.all()
if (isMedia && !mek.message.videoMessage || isQuotedImage) {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
buff = await client.downloadMediaMessage(encmedia)
for (let _ of anu) {
client.sendMessage(_.jid, buff, image, {caption: `❮ 𝙋𝙀𝙎𝘼?? 𝘽??𝙊𝘼𝘿𝘾𝘼𝙎𝙏 ❯\n\n${body.slice(4)}`})
}
reply('𝙨𝙪𝙘𝙘𝙚𝙨𝙨 𝙗𝙧𝙤𝙖𝙙𝙘𝙖𝙨𝙩 ')
} else {
for (let _ of anu) {
sendMess(_.jid, `*「 BROADCAST BOT 」*\n\n${body.slice(4)}`)
}
reply('𝙨𝙪𝙘𝙘𝙚𝙨𝙨 𝙗𝙧𝙤𝙖𝙙𝙘𝙖𝙨𝙩 ')
}
break
case 'setpp':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
media = await client.downloadAndSaveMediaMessage(mek)
await client.updateProfilePicture (from, media)
reply('𝗦𝘂𝗸𝘀𝗲𝘀 𝗺𝗲𝗻𝗴𝗴𝗮𝗻𝘁𝗶 𝗶𝗰𝗼𝗻 𝗚𝗿𝘂𝗽')
break
case 'add':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
if (args.length < 1) return reply('Yang mau di add jin ya?')
if (args[0].startsWith('08')) return reply('Gunakan kode negara mas')
try {
num = `${args[0].replace(/ /g, '')}@s.whatsapp.net`
client.groupAdd(from, [num])
} catch (e) {
console.log('Error :', e)
reply('Gagal menambahkan target, mungkin karena di private')
}
break
case 'grup':
case 'group':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
if (args[0] === 'buka') {
reply(`𝗕𝗲𝗿𝗵𝗮𝘀𝗶?? 𝗠𝗲𝗺𝗯𝘂𝗸𝗮 𝗚𝗿𝗼𝘂𝗽 𝗧𝗼𝗱`)
client.groupSettingChange(from, GroupSettingChange.messageSend, false)
} else if (args[0] === 'tutup') {
reply(`𝗕𝗲𝗿𝗵𝗮𝘀𝗶𝗹 𝗠𝗲𝗻𝘂𝘁𝘂𝗽 𝗚𝗿𝗼𝘂𝗽 𝗧𝗼𝗱`)
client.groupSettingChange(from, GroupSettingChange.messageSend, true)
}
break
case 'admin':
case 'owner':
case 'creator':
if (getLevelingLevel(sender) < ahf ) return reply(ind.reglevelahf(command, pushname, getLevelingLevel, sender, ahf))
client.sendMessage(from, {displayname: "Jeff", vcard: vcard}, MessageType.contact, { quoted: mek})
client.sendMessage(from, 'Tuh nomer owner ku >_<, jangan spam atau ku block kamu',MessageType.text, { quoted: mek} )
break
case 'setname':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
client.groupUpdateSubject(from, `${body.slice(9)}`)
client.sendMessage(from, 'Succes, Ganti Nama Grup', text, {quoted: mek})
break
case 'setdesc':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
client.groupUpdateDescription(from, `${body.slice(9)}`)
client.sendMessage(from, 'Succes, Ganti Deskripsi Grup', text, {quoted: mek})
break
case 'demote':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('𝗧𝗮𝗴 𝘁𝗮𝗿𝗴𝗲𝘁 𝘆𝗮𝗻𝗴 𝗶𝗻𝗴𝗶𝗻 𝗱𝗶 𝘁𝗲𝗻𝗱𝗮𝗻𝗴!')
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
if (mentioned.length > 1) {
teks = ''
for (let _ of mentioned) {
teks += `𝘆𝗮𝗵𝗵 𝗷𝗮??𝗮𝘁𝗮𝗻 𝗮𝗱𝗺𝗶𝗻 𝗸𝗮𝗺𝘂 𝘀𝘂𝗱𝗮𝗵 𝗱𝗶 𝗰𝗼𝗽𝗼𝘁🏃 :\n`
teks += `@_.split('@')[0]`
}
mentions(teks, mentioned, true)
client.groupDemoteAdmin(from, mentioned)
} else {
mentions(`𝘆𝗮𝗵𝗵 @${mentioned[0].split('@')[0]} 𝗷𝗮𝗯𝗮𝘁𝗮𝗻 𝗮𝗱𝗺𝗶𝗻 𝗸𝗮𝗺𝘂 𝘀𝘂𝗱𝗮𝗵 𝗱𝗶 𝗰𝗼𝗽𝗼𝘁🏃`, mentioned, true)
client.groupDemoteAdmin(from, mentioned)
}
break
case 'promote':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('𝗧𝗮𝗴 𝘁𝗮𝗿𝗴𝗲𝘁 𝘆𝗮𝗻𝗴 𝗶𝗻𝗴𝗶𝗻 𝗱𝗶 𝘁𝗲𝗻𝗱𝗮𝗻𝗴!')
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
if (mentioned.length > 1) {
teks = ''
for (let _ of mentioned) {
teks += `𝗦𝗲𝗹𝗮𝗺𝗮𝘁🥳 𝗮𝗻𝗱𝗮 𝗻𝗮𝗶𝗸 𝗺𝗲𝗻𝗷𝗮𝗱𝗶 𝗮𝗱𝗺𝗶𝗻 𝗴𝗿𝗼𝘂𝗽 (+_+) :\n`
teks += `@_.split('@')[0]`
}
mentions(teks, mentioned, true)
client.groupMakeAdmin(from, mentioned)
} else {
mentions(`𝗦𝗲𝗹𝗮𝗺𝗮𝘁🥳 @${mentioned[0].split('@')[0]} 𝗮𝗻𝗱𝗮 𝗻𝗮𝗶𝗸 𝗺𝗲𝗻𝗷𝗮𝗱𝗶 𝗮??𝗺𝗶𝗻 𝗴𝗿𝗼𝘂?? (+_+)`, mentioned, true)
client.groupMakeAdmin(from, mentioned)
}
break
case 'kick':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (!isBotGroupAdmins) return reply(ind.badmin())
if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('𝗧𝗮𝗴 𝘁𝗮𝗿𝗴𝗲𝘁 𝘆𝗮𝗻𝗴 𝗶𝗻𝗴𝗶𝗻 𝗱𝗶 𝘁𝗲𝗻𝗱𝗮𝗻𝗴!')
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
if (mentioned.length > 1) {
teks = ''
for (let _ of mentioned) {
teks += `𝗔𝘀𝗲𝗸 𝗱𝗮𝗽𝗮𝘁 𝗺𝗮𝗸𝗮𝗻𝗮𝗻,𝗼𝘁𝘄 𝗸𝗶𝗰𝗸 🏃 :\n`
teks += `@_.split('@')[0]`
}
mentions(teks, mentioned, true)
client.groupRemove(from, mentioned)
} else {
mentions(`𝗔𝘀𝗲𝗸 𝗱𝗮𝗽𝗮𝘁 𝗺𝗮𝗸𝗮𝗻𝗮𝗻,𝗼𝘁𝘄 𝗸𝗶𝗰𝗸 @${mentioned[0].split('@')[0]} 🏃`, mentioned, true)
client.groupRemove(from, mentioned)
}
break
case 'listadmin':
if (!isGroup) return reply(ind.groupo())
teks = `𝗟𝗶𝘀𝘁 𝗮𝗱𝗺𝗶𝗻 𝗼𝗳 𝗴𝗿𝗼𝘂𝗽 *${groupMetadata.subject}*\n𝗧𝗼𝘁𝗮𝗹 : ${groupAdmins.length}\n\n`
no = 0
for (let admon of groupAdmins) {
no += 1
teks += `[${no.toString()}] @${admon.split('@')[0]}\n`
}
mentions(teks, groupAdmins, true)
break
case 'toimg':
if (!isRegistered) return reply(ind.noregis())
if (getLevelingLevel(sender) < ahb ) return reply(ind.reglevelahb(command, pushname, getLevelingLevel, sender, ahb))
if (!isQuotedSticker) return reply('𝗥𝗲𝗽𝗹𝘆/𝘁𝗮𝗴 𝘀𝘁𝗶𝗰𝗸𝗲𝗿 !')
reply(ind.wait())
encmedia = JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo
media = await client.downloadAndSaveMediaMessage(encmedia)
ran = getRandom('.png')
exec(`ffmpeg -i ${media} ${ran}`, (err) => {
fs.unlinkSync(media)
if (err) return reply(ind.stikga())
buffer = fs.readFileSync(ran)
client.sendMessage(from, buffer, image, {quoted: mek, caption: '𝗱𝗮?? 𝗷𝗮𝗱𝗶 '})
fs.unlinkSync(ran)
})
break
case 'simi':
if (args.length < 1) return reply('Textnya mana um?')
teks = body.slice(5)
anu = await simih(teks) //fetchJson(`https://mhankbarbars.herokuapp.com/api/samisami?text=${teks}`, {method: 'get'})
//if (anu.error) return reply('Simi ga tau kak')
reply(anu)
break
case 'simih':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (args.length < 1) return reply('Boo :𝘃')
if (Number(args[0]) === 1) {
if (isSimi) return reply('𝘀𝘂𝗱𝗮𝗵 𝗮𝗸𝘁𝗶𝗳 !!!')
samih.push(from)
fs.writeFileSync('./src/simi.json', JSON.stringify(samih))
reply('❬ 𝗦𝗨𝗞𝗦𝗘𝗦 ❭ 𝗠𝗲𝗻𝗴𝗮𝗸𝘁𝗶𝗳𝗸𝗮𝗻 𝗳𝗶𝘁𝘂𝗿 𝘀𝗶𝗺𝗶 𝗱𝗶 𝗴𝗿𝗼𝘂𝗽 𝗶𝗻𝗶️')
} else if (Number(args[0]) === 0) {
samih.splice(from, 1)
fs.writeFileSync('./src/simi.json', JSON.stringify(samih))
reply('❬ 𝗦𝗨𝗞𝗦𝗘𝗦 ❭ 𝗠𝗲𝗻𝗼𝗻𝗮𝗸𝘁𝗶𝗳𝗸𝗮𝗻 𝗳𝗶𝘁𝘂𝗿 𝘀𝗶𝗺𝗶 𝗱𝗶 𝗴𝗿𝗼𝘂𝗽 𝗶𝗻𝗶️️')
} else {
reply(' *Ketik perintah 1 untuk mengaktifkan, 0 untuk menonaktifkan* \n𝗰𝗼𝗻𝘁𝗼𝗵: 𝘀𝗶𝗺𝗶𝗵 𝟭')
}
break
case 'nsfw':
if (!isGroup) return reply(ind.groupo())
if (!isGroupAdmins) return reply(ind.admin())
if (args.length < 1) return reply('Boo :𝘃')
if (Number(args[0]) === 1) {
if (isNsfw) return reply(' *sudah aktif* !!')
nsfw.push(from)