-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
3268 lines (3161 loc) · 164 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
/* KALO MAU AMBIL AMBIL AJA BANG
* TAPI JANGAN HAPUS TQTO!!
*
* THX TO
* ARA
* YEYENCANGTIP
* ADULALHY
* MEM TOT
*/
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 util = require('util')
const imageToBase64 = require('image-to-base64')
const axios = require('axios')
const { color, bgcolor } = require('./lib/color')
const { bahasa } = require('./lib/bahasa')
const { negara } = require('./lib/kodenegara')
const { donasi } = require('./lib/donasi')
const { developer } = require('./lib/developer')
const { randompict } = require('./lib/randompict')
const { fetchJson } = require('./lib/fetcher')
const { recognize } = require('./lib/ocr')
const fontPath = ('./lib/Zahmeka.ttf')
const path = require('path')
const { exec, spawn } = 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 brainly = require('brainly-scraper')
const ffmpeg = require('fluent-ffmpeg')
const cd = 4.32e+7
const { removeBackgroundFromImageFile } = require('remove.bg')
const { ind } = require('./bahasa')
/********** MENU SETTING **********/
const vcard = 'BEGIN:VCARD\n'
+ 'VERSION:3.0\n'
+ 'FN:Yeyen Cangtip\n'
+ 'ORG: OwnerBot;\n'
+ 'TEL;type=CELL;type=VOICE;waid=6283186893249:+62 831-8689-3249\n'
+ 'END:VCARD'
prefix = '.'
blocked = []
limitawal = 25
memberlimit = 1
cr = '*Yeyen Cangtip*'
fakeimage = fs.readFileSync(`./src/logo.jpg`)
replitx = '*YEYEN CANGTIP*'
ari = '*YEYEN CANGTIP*'
/******** OWNER NUMBER**********/
const ownerNumber = ['6283186893249@s.whatsapp.net','6281390199407@s.whatsapp.net']
const pacarNumber = ["6281390199407@s.whatsapp.net"]
/************************************/
/*********** LOAD FILE ***********/
const _leveling = JSON.parse(fs.readFileSync('./database/kelompok/leveling.json'))
const antilink = JSON.parse(fs.readFileSync('./database/kelompok/antilink.json'))
const _level = JSON.parse(fs.readFileSync('./database/pengguna/level.json'))
const _registered = JSON.parse(fs.readFileSync('./database/bot/pengguna.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'))
const event = JSON.parse(fs.readFileSync('./database/bot/event.json'))
const _limit = JSON.parse(fs.readFileSync('./database/pengguna/limit.json'))
const uang = JSON.parse(fs.readFileSync('./database/pengguna/uang.json'))
const ban = JSON.parse(fs.readFileSync('./database/pengguna/banned.json'))
const prem = JSON.parse(fs.readFileSync('./database/pengguna/premium.json'))
const adm = JSON.parse(fs.readFileSync('./database/pengguna/admin.json'))
const bad = JSON.parse(fs.readFileSync('./database/kelompok/bad.json'))
const badword = JSON.parse(fs.readFileSync('./database/kelompok/badword.json'))
/*********** END LOAD ***********/
/********** 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].id
}
}
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/pengguna/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/pengguna/level.json', JSON.stringify(_level))
}
}
const addLevelingId = (sender) => {
const obj = {id: sender, xp: 1, level: 1}
_level.push(obj)
fs.writeFileSync('./database/pengguna/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/pengguna.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
}
const addATM = (sender) => {
const obj = {id: sender, uang : 0}
uang.push(obj)
fs.writeFileSync('./database/pengguna/uang.json', JSON.stringify(uang))
}
const addKoinUser = (sender, amount) => {
let position = false
Object.keys(uang).forEach((i) => {
if (uang[i].id === sender) {
position = i
}
})
if (position !== false) {
uang[position].uang += amount
fs.writeFileSync('./database/pengguna/uang.json', JSON.stringify(uang))
}
}
const checkATMuser = (sender) => {
let position = false
Object.keys(uang).forEach((i) => {
if (uang[i].id === sender) {
position = i
}
})
if (position !== false) {
return uang[position].uang
}
}
const bayarLimit = (sender, amount) => {
let position = false
Object.keys(_limit).forEach((i) => {
if (_limit[i].id === sender) {
position = i
}
})
if (position !== false) {
_limit[position].limit -= amount
fs.writeFileSync('./database/pengguna/limit.json', JSON.stringify(_limit))
}
}
const confirmATM = (sender, amount) => {
let position = false
Object.keys(uang).forEach((i) => {
if (uang[i].id === sender) {
position = i
}
})
if (position !== false) {
uang[position].uang -= amount
fs.writeFileSync('./database/pengguna/uang.json', JSON.stringify(uang))
}
}
const limitAdd = (sender) => {
let position = false
Object.keys(_limit).forEach((i) => {
if (_limit[i].id == sender) {
position = i
}
})
if (position !== false) {
_limit[position].limit += 1
fs.writeFileSync('./database/pengguna/limit.json', JSON.stringify(_limit))
}
}
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)} Jam ${pad(minutes)} Menit ${pad(seconds)} Detik`
}
//---Metadata stiker
function addMetadata(packname, author) {
if (!packname) packname = 'Yeyen Cangtip'; if (!author) author = 'Bot Yeyen';
author = author.replace(/[^a-zA-Z0-9]/g, '');
let name = `${author}_${packname}`
if (fs.existsSync(`./src/stickers/${name}.exif`)) return `./src/stickers/${name}.exif`
const json = {
"sticker-pack-name": packname,
"sticker-pack-publisher": author,
}
const littleEndian = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00])
const bytes = [0x00, 0x00, 0x16, 0x00, 0x00, 0x00]
let len = JSON.stringify(json).length
let last
if (len > 256) {
len = len - 256
bytes.unshift(0x01)
} else {
bytes.unshift(0x00)
}
if (len < 16) {
last = len.toString(16)
last = "0" + len
} else {
last = len.toString(16)
}
const buf2 = Buffer.from(last, "hex")
const buf3 = Buffer.from(bytes)
const buf4 = Buffer.from(JSON.stringify(json))
const buffer = Buffer.concat([littleEndian, buf2, buf3, buf4])
fs.writeFile(`./src/stickers/${name}.exif`, buffer, (err) => {
return `./src/stickers/${name}.exif`
})
}
/********** FUNCTION ***************/
const ara = new WAConnection()
async function starts() {
const ara = new WAConnection()
ara.logger.level = 'warn'
console.log(banner.string)
ara.on('qr', () => {
console.log(color('[','white'), color('!','red'), color(']','white'), color(' Scan the qr code above'))
})
fs.existsSync('./session.json') && ara.loadAuthInfo('./session.json')
ara.on('connecting', () => {
start('2', 'Connecting...')
})
ara.on('open', () => {
success('2', 'Connected')
})
await ara.connect({timeoutMs: 30*1000})
fs.writeFileSync('./session.json', JSON.stringify(ara.base64EncodedAuthInfo(), null, '\t'))
ara.on('group-participants-update', async (anu) => {
if (!welkom.includes(anu.jid)) return
try {
const mdata = await ara.groupMetadata(anu.jid)
console.log(anu)
if (anu.action == 'add') {
num = anu.participants[0]
try {
ppimg = await ara.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]}\nSelamat datang di group *${mdata.subject}*\nJangan rese ya bor\nJangan lupa intro @${num.split('@')[0]} 🗣`
let buff = await getBuffer(ppimg)
ara.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
} else if (anu.action == 'remove') {
num = anu.participants[0]
try {
ppimg = await ara.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 = `*Satu beban telah hilang* \n@${num.split('@')[0]}\n*Semoga jasadmu baik baik saja dan di kenang orang yg berada disini🚮*`
let buff = await getBuffer(ppimg)
ara.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
}
} catch (e) {
console.log('Error : %s', color(e, 'red'))
}
})
ara.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'))
}
})
ara.on("CB:action,,call", async json => {
const callerId = json[2][0][1].from;
console.log(json);
//if (setting.responder.call.status){
ara.sendMessage(
callerId,
"Auto block system, don't call please",
MessageType.text
);
await sleep(4000);
await frhan.blockUser(callerId, "add"); // Block user
//}
});
ara.on('chat-update', async (mek) => {
try {
if (!mek.hasNewMessage) return
mek = mek.messages.all()[0]
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 timi = moment.tz('Asia/Jakarta').add(30, 'days').calendar();
const timu = moment.tz('Asia/Jakarta').add(20, '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 : ''
var pes = (type === 'conversation' && mek.message.conversation) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text ? mek.message.extendedTextMessage.text : ''
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const messagesC = pes.slice(0).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const tescuk = ["0@s.whatsapp.net"]
const isGroup = from.endsWith('@g.us')
const q = args.join(' ')
const botNumber = ara.user.jid
const sender = isGroup ? mek.participant : mek.key.remoteJid
pushname = ara.contacts[sender] != undefined ? ara.contacts[sender].vname || ara.contacts[sender].notify : undefined
const groupMetadata = isGroup ? await ara.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) : ''
/************** SCURITY FEATURE ************/
const isEventon = isGroup ? event.includes(from) : false
const isBadWord = isGroup ? badword.includes(from) : false
const isRegistered = checkRegisteredUser(sender)
const isBotGroupAdmins = groupAdmins.includes(botNumber) || false
const isLevelingOn = isGroup ? _leveling.includes(from) : 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 isAntilink = isGroup ? antilink.includes(from) : false
const isOwner = ownerNumber.includes(sender)
const isPacar = pacarNumber.includes(sender)
const isBanned = ban.includes(sender)
const isPremium= prem.includes(sender)
const isAdmin = adm.includes(sender)
const isImage = type === 'imageMessage'
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) => {
ara.sendMessage(from, teks, text, {quoted:mek})
}
const sendMess = (hehe, teks) => {
ara.sendMessage(hehe, teks, text)
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? ara.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : ara.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": memberr}})
}
const sendImage = (teks) => {
ara.sendMessage(from, teks, image, {quoted:mek})
}
const costum = (pesan, tipe, target, target2) => {
ara.sendMessage(from, pesan, tipe, {quoted: { key: { fromMe: false, participant: `${target}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target2}` }}})
}
const sendPtt = (teks) => {
ara.sendMessage(from, audio, mp3, {quoted:mek})
}
/*****************END SCURITY FEATURE ********/
const levelRole = getLevelingLevel(sender)
var role = 'Newbie ㋡'
if (levelRole <= 2) {
role = 'Newbie ㋡'
} else if (levelRole <= 4) {
role = 'Warrior III'
} else if (levelRole <= 6) {
role = 'Warrior II'
} else if (levelRole <= 8) {
role = 'Warrior I'
} else if (levelRole <= 10) {
role = 'Elite III'
} else if (levelRole <= 12) {
role = 'Elite II'
} else if (levelRole <= 14) {
role = 'Elite I'
} else if (levelRole <= 16) {
role = 'Master IV'
} else if (levelRole <= 18) {
role = 'Master III'
} else if (levelRole <= 20) {
role = 'Master II'
} else if (levelRole <= 22) {
role = 'Master I'
} else if (levelRole <= 24) {
role = 'Grand Master V'
} else if (levelRole <= 26) {
role = 'Grand Master IV'
} else if (levelRole <= 28) {
role = 'Grand Master III'
} else if (levelRole <= 30) {
role = 'Grand Master II'
} else if (levelRole <= 32) {
role = 'Grand Master I'
} else if (levelRole <= 34) {
role = 'Epic V'
} else if (levelRole <= 36) {
role = 'Epic IV'
} else if (levelRole <= 38) {
role = 'Epic III'
} else if (levelRole <= 40) {
role = 'Epic II'
} else if (levelRole <= 42) {
role = 'Epic 1'
} else if (levelRole <= 44) {
role = 'Legends V'
} else if (levelRole <= 46) {
role = 'L3gends IV'
} else if (levelRole <= 48) {
role = 'Legends III'
} else if (levelRole <= 50) {
role = 'Legends II'
} else if (levelRole <= 52) {
role = 'Legends I'
} else if (levelRole <= 54) {
role = 'Mythic X'
} else if (levelRole <= 56) {
role = 'Mythic IX'
} else if (levelRole <= 58) {
role = 'Mythic VIII'
} else if (levelRole <= 60) {
role = 'Mythic VII'
} else if (levelRole <= 62) {
role = 'Mythic VI'
} else if (levelRole <= 64) {
role = 'Mythic V'
} else if (levelRole <= 66) {
role = 'Mythic IV'
} else if (levelRole <= 68) {
role = 'Mythic III'
} else if (levelRole <= 70) {
role = 'Mythic II'
} else if (levelRole <= 72) {
role = 'Mythic I'
} else if (levelRole <= 74) {
role = 'Glorious Mythic V'
} else if (levelRole <= 76) {
role = 'Glorious Mythic IV'
} else if (levelRole <= 78) {
role = 'Glorious Mythic III'
} else if (levelRole <= 80) {
role = 'Glorious Mythic II'
} else if (levelRole <= 82) {
role = 'Glorious Mythic I'
} else if (levelRole <= 84) {
role = 'Mythical Glory V'
} else if (levelRole <= 86) {
role = 'Mythical Glory IV'
} else if (levelRole <= 88) {
role = 'Mythical Glory III'
} else if (levelRole <= 90) {
role = 'Mythical Glory II'
} else if (levelRole <= 92) {
role = 'Mythical Glory I'
} else if (levelRole <= 94) {
role = 'Tough Platinum V'
} else if (levelRole <= 96) {
role = 'Tough Platinum IV'
} else if (levelRole <= 98) {
role = 'Tough Platinum III'
} else if (levelRole <= 100) {
role = 'Tough Platinum II'
} else if (levelRole <= 102) {
role = 'Tough Platinum I'
} else if (levelRole <= 104) {
role = 'Diamond Star V'
} else if (levelRole <= 106) {
role = 'Diamond Star IV'
} else if (levelRole <= 108) {
role = 'Diamond Star III'
} else if (levelRole <= 110) {
role = 'Diamond Star II'
} else if (levelRole <= 112) {
role = 'Diamond Star I'
} else if (levelRole <= 114) {
role = 'Glory Crown V'
} else if (levelRole <= 116) {
role = 'Glory Crown IV'
} else if (levelRole <= 118) {
role = 'Glory Crown III'
} else if (levelRole <= 120) {
role = 'Glory Crown II'
} else if (levelRole <= 122) {
role = 'Glory Crown I'
} else if (levelRole <= 124) {
role = 'Super Ace V'
} else if (levelRole <= 126) {
role = 'Super Ace IV'
} else if (levelRole <= 128) {
role = 'Super Ace III'
} else if (levelRole <= 130) {
role = 'Super Ace II'
} else if (levelRole <= 132) {
role = 'Super Ace I'
} else if (levelRole <= 134) {
role = 'Conqueror V'
} else if (levelRole <= 136) {
role = 'Conqueror IV'
} else if (levelRole <= 138) {
role = 'Conqueror III'
} else if (levelRole <= 140) {
role = 'Conqueror II'
} else if (levelRole <= 142) {
role = 'Conqueror I'
} else if (levelRole <= 144) {
role = 'Emerald V'
} else if (levelRole <= 146) {
role = 'Emerald IV'
} else if (levelRole <= 148) {
role = 'Emerald III'
} else if (levelRole <= 152) {
role = 'Emerald II 忍'
} else if (levelRole <= 154) {
role = 'Emerald I 忍'
} else if (levelRole <= 156) {
role = 'Challangers 忍'
} else if (levelRole <= 158) {
role = 'Challangers 忍'
} else if (levelRole <= 160) {
role = 'Challangers 忍'
} else if (levelRole <= 162) {
role = 'Challangers 忍'
} else if (levelRole <= 164) {
role = 'Challangers 忍'
} else if (levelRole <= 166) {
role = 'Challangers 忍'
} else if (levelRole <= 168) {
role = 'Challangers 忍'
} else if (levelRole <= 170) {
role = 'Challangers 忍'
} else if (levelRole <= 172) {
role = 'Challangers 忍'
} else if (levelRole <= 174) {
role = 'Challangers 忍'
} else if (levelRole <= 176) {
role = 'Challangers 忍'
} else if (levelRole <= 178) {
role = 'Challangers 忍'
} else if (levelRole <= 180) {
role = 'Challangers 忍'
} else if (levelRole <= 182) {
role = 'Challangers 忍'
} else if (levelRole <= 184) {
role = 'Challangers 忍'
} else if (levelRole <= 186) {
role = 'Challangers 忍'
} else if (levelRole <= 188) {
role = 'Challangers 忍'
} else if (levelRole <= 190) {
role = 'Challangers 忍'
} else if (levelRole <= 192) {
role = 'Challangers 忍'
} else if (levelRole <= 194) {
role = 'Challangers 忍'
} else if (levelRole <= 196) {
role = 'Challangers 忍'
} else if (levelRole <= 198) {
role = 'Challangers 忍'
} else if (levelRole <= 200) {
role = 'Challangers 忍'
} else if (levelRole <= 210) {
role = 'Challangers 忍'
} else if (levelRole <= 220) {
role = 'Challangers 忍'
} else if (levelRole <= 230) {
role = 'Challangers 忍'
} else if (levelRole <= 240) {
role = 'Challangers 忍'
} else if (levelRole <= 250) {
role = 'Challangers 忍'
} else if (levelRole <= 260) {
role = 'Challangers 忍'
} else if (levelRole <= 270) {
role = 'Challangers 忍'
} else if (levelRole <= 280) {
role = 'Challangers 忍'
} else if (levelRole <= 290) {
role = 'Challangers 忍'
} else if (levelRole <= 300) {
role = 'Challangers 忍'
} else if (levelRole <= 310) {
role = 'Challangers 忍'
} else if (levelRole <= 320) {
role = 'Challangers 忍'
} else if (levelRole <= 330) {
role = 'Challangers 忍'
} else if (levelRole <= 340) {
role = 'Challangers 忍'
} else if (levelRole <= 350) {
role = 'Challangers 忍'
} else if (levelRole <= 360) {
role = 'Challangers 忍'
} else if (levelRole <= 370) {
role = 'Challangers 忍'
} else if (levelRole <= 380) {
role = 'Challangers 忍'
} else if (levelRole <= 390) {
role = 'Challangers 忍'
} else if (levelRole <= 400) {
role = 'Challangers 忍'
} else if (levelRole <= 410) {
role = 'Challangers 忍'
} else if (levelRole <= 420) {
role = 'Challangers 忍'
} else if (levelRole <= 430) {
role = 'Challangers 忍'
} else if (levelRole <= 440) {
role = 'Challangers 忍'
} else if (levelRole <= 450) {
role = 'Challangers 忍'
} else if (levelRole <= 460) {
role = 'Challangers 忍'
} else if (levelRole <= 470) {
role = 'Challangers 忍'
} else if (levelRole <= 480) {
role = 'Challangers 忍'
} else if (levelRole <= 490) {
role = 'Challangers 忍'
} else if (levelRole <= 500) {
role = 'Challangers 忍'
} else if (levelRole <= 600) {
role = 'Challangers 忍'
} else if (levelRole <= 700) {
role = 'Challangers 忍'
} else if (levelRole <= 800) {
role = 'Challangers 忍'
} else if (levelRole <= 900) {
role = 'Challangers 忍'
} else if (levelRole <= 1000) {
role = 'Challangers 忍'
} else if (levelRole <= 2000) {
role = 'Challangers 忍'
} else if (levelRole <= 3000) {
role = 'Challangers 忍'
} else if (levelRole <= 4000) {
role = 'Challangers 忍'
} else if (levelRole <= 5000) {
role = 'Challangers 忍'
} else if (levelRole <= 6000) {
role = 'Challangers 忍'
} else if (levelRole <= 7000) {
role = 'Challangers 忍'
} else if (levelRole <= 8000) {
role = 'Challangers 忍'
} else if (levelRole <= 9000) {
role = 'Challangers 忍'
} else if (levelRole <= 10000) {
role = 'King 忍'
var prema = 'Free'
if (!isAdmin) {
prema = 'Adminban'
}
if (!isPremium) {
prema = 'Premium'
}
if (!isOwner) {
prema = 'Owner'
}
}
for (let kemem of bad) {
if (budy.includes(kemem)) {
if (!isGroup) return
if (!isBadWord) return
if (isGroupAdmins) return reply('Untung Kau Admin:) Btw Jangan Ngegas Om😘')
if (isOwner) return reply ('untung kamu owner aku :v Btw jan marah yaa')
ara.updatePresence(from, Presence.composing)
var kic = `${sender.split("@")[0]}@s.whatsapp.net`
reply(`Woyy ${sender.split("@")[0]} Jangan Ngomong Kasar Ngemtod😡`)
setTimeout(() => {
ara.groupRemove(from, [kic]).catch((e) => { reply(`BOT HARUS JADI ADMIN`) })
}, 3000)
setTimeout(() => {
ara.updatePresence(from, Presence.composing)
reply("Babay")
}, 2000)
setTimeout(() => {
ara.updatePresence(from, Presence.composing)
reply("Siap Siap Di Kick")
}, 1000)
setTimeout(() => {
ara.updatePresence(from, Presence.composing)
reply("Lu Udah Ngomong Kasar")
}, 0)
}
}
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) + 100
const requiredXp = 5000 * (Math.pow(2, currentLevel) - 1)
const getLevel = getLevelingLevel(sender)
addLevelingXp(sender, amountXp)
if (requiredXp <= getLevelingXp(sender)) {
addLevelingLevel(sender, 1)
bayarLimit(sender, 3)
await reply(ind.levelup(pushname, sender, getLevelingXp, getLevel, getLevelingLevel, role))
}
} catch (err) {
console.error(err)
}
}
const checkLimit = (sender) => {
let found = false
for (let lmt of _limit) {
if (lmt.id === sender) {
let limitCounts = limitawal - lmt.limit
if (limitCounts <= 0) return ara.sendMessage(from,`Limit request anda sudah habis\n\n_Note : limit bisa di dapatkan dengan cara ${prefix}buylimit dan dengan naik level_`, text,{ quoted: mek})
ara.sendMessage(from, ind.limitcount(limitCounts), text, { quoted : mek})
found = true
}
}
if (found === false) {
let obj = { id: sender, limit: 0 }
_limit.push(obj)
fs.writeFileSync('./database/pengguna/limit.json', JSON.stringify(_limit))
ara.sendMessage(from, ind.limitcount(limitCounts), text, { quoted : mek})
}
}
const isLimit = (sender) =>{
let position = false
for (let i of _limit) {
if (i.id === sender) {
let limits = i.limit
if (limits >= limitawal ) {
position = true
ara.sendMessage(from, ind.limitend(pushname), text, {quoted: mek})
return true
} else {
_limit
position = true
return false
}
}
}
if (position === false) {
const obj = { id: sender, limit: 0 }
_limit.push(obj)
fs.writeFileSync('./database/pengguna/limit.json',JSON.stringify(_limit))
return false
}
}
if (isGroup) {
try {
const getmemex = groupMembers.length
if (getmemex <= memberlimit) {
}
} catch (err) { console.error(err) }
}
if (isRegistered ) {
const checkATM = checkATMuser(sender)
try {
if (checkATM === undefined) addATM(sender)
const uangsaku = Math.floor(Math.random() * 10) + 90
addKoinUser(sender, uangsaku)
} catch (err) {
console.error(err)
}
}
if (budy.includes("://chat.whatsapp.com/")){
if (!isGroup) return
if (!isAntilink) return
if (isGroupAdmins) return reply('Admin Grup Mah Bebass!!')
ara.updatePresence(from, Presence.composing)
if (messagesC.includes("#izinadmin")) return reply("#izinadmin diterima")
var kic = `${sender.split("@")[0]}@s.whatsapp.net`
reply(`Link Group Terdeteksi! ${sender.split("@")[0]} yahahaha ngemis member awkwkwwk`)
setTimeout( () => {
ara.groupRemove(from, [kic]).catch((e)=>{reply(`*ERR:* ${e}`)})
}, 1000)
setTimeout( () => {
ara.updatePresence(from, Presence.composing)
reply("Bissmilah headshot!!")
}, 0)
}
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)
if(isNaN(umurUser)) return await reply('Umur harus berupa angka!!')
if (namaUser.length >= 30) return reply(`why is your name so long it's a name or a train`)
if (umurUser > 40) return reply(`your age is too old maximum 40 years`)
if (umurUser < 14) return reply(`your age is too young minimum 14 years`)
fs.writeFileSync("./database/pengguna/user.json", JSON.stringify(user));
try {
ppimg = await ara.getProfilePicture(`${sender.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'
}
veri = sender
if (isGroup) {
addRegisteredUser(sender, namaUser, umurUser, time, serialUser)
await ara.sendMessage(from, ppimg, image, {quoted: mek, caption: ind.registered(namaUser, umurUser, serialUser, time, sender)})
addATM(sender)
addLevelingId(sender)
checkLimit(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 ara.sendMessage(from, ppimg, image, {quoted: mek, caption: ind.registered(namaUser, umurUser, serialUser, time, sender)})
addATM(sender)
addLevelingId(sender)
checkLimit(sender)
console.log(color('[REGISTER]'), color(time, 'yellow'), 'Name:', color(namaUser, 'cyan'), 'Age:', color(umurUser, 'cyan'), 'Serial:', color(serialUser, 'cyan'))
}
break
case 'setprefix':
if (args.length < 1) return
if (!isOwner) return reply(ind.ownerb())
prefix = args[0]
reply(`*Prefix berhasil di ubah menjadi* : ${prefix}`)
break
case 'help':
case 'menu':
if (!isRegistered) return reply( ind.noregis())
costum('[❗] LOADING!', text, tescuk, ari)
if (isBanned) return reply('Kamu terbanned!')
const reqXp = 5000 * (Math.pow(2, getLevelingLevel(sender)) - 1)
const uangku = checkATMuser(sender)
try {
ppimg = await ara.getProfilePicture(
`${sender.split("@")[0]}@s.whatsapp.net`
);
} catch {
ppimg = "https://i.ibb.co/Gp4H47k/7dba54f7e250.jpg";
}
teks = `
┏━━► *「 YOUR INFO 」*
┃
┣► Prefix : 「 ${prefix} 」
┣► Nama : ${pushname}
┣► Role : *${role}*
┣► Level : ${getLevelingLevel(sender)}
┗━━━━━━━━━━━►
┏━━► *「 INFO MENU 」*
┣► *${prefix}info*
┣► *${prefix}snk*
┣► *${prefix}request*
┣► *${prefix}blocklist*
┣► *${prefix}owner*
┣► *${prefix}ping*
┣► *${prefix}buypremium*
┣► *${prefix}hargaprem*
┣► *${prefix}linkgc1*
┗━━━━━━━━━━━►
┏━━► *「 APK MENU 」*
┣► *${prefix}apkpure*
┗━━━━━━━━━━━►
┏━━► *「 GAME MENU 」*
┣► *${prefix}tebakgambar*
┗━━━━━━━━━━━►
┏━━► *「 MEDSOS MENU 」*
┣► *${prefix}github*
┣► *${prefix}twitter*
┣► *${prefix}tiktokstalk*
┣► *${prefix}igstalk*
┗━━━━━━━━━━━►
┏━━► *「 GROUP MENU 」*
┣► *${prefix}welcome [1/0]*
┣► *${prefix}nsfw [1/0]*
┣► *${prefix}leveling [1/0]*
┣► *${prefix}nobadword [1/0]*
┣► *${prefix}simih [1/0]*
┣► *${prefix}promote [@tag]*
┣► *${prefix}demote [@tag]*
┣► *${prefix}add [62]*
┣► *${prefix}kick [@tag]*
┣► *${prefix}group [open/close]*
┣► *${prefix}antilinkgc [1/0]*
┣► *${prefix}addbadword*