-
Notifications
You must be signed in to change notification settings - Fork 28
/
iqbal.js
2962 lines (2905 loc) · 177 KB
/
iqbal.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
/*
* Mao ngapain lo ngentod
* Tambahin nama author lah ngentod
* Author nya Muhammad Iqbal
* Jan numpang nama doank
* Baca readme nya tolol biar gk nanya nanya, bego dasar
- What's New?
* Fix menu & New Fiture
*/
const {
WAConnection,
MessageType,
Presence,
Mimetype,
GroupSettingChange,
MessageOptions,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
waChatKey,
mentionedJid,
processTime,
} = require('@adiwajshing/baileys')
// Load Js File
const { color, bgcolor } = require('./lib/color')
const { bahasa } = require('./src/bahasa')
const { negara } = require('./src/kodenegara')
const { virtex } = require('./src/virtex')
const { virtex2 } = require('./src/virtex2')
const { wait, simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, start, info, success, close } = require('./lib/functions')
const { fetchJson } = require('./lib/fetcher')
const { recognize } = require('./lib/ocr')
// Load Npm Package
const fs = require('fs')
const moment = require('moment-timezone')
const { exec } = require('child_process')
const kagApi = require('@kagchi/kag-api')
const fetch = require('node-fetch')
const tiktod = require('tiktok-scraper')
const ffmpeg = require('fluent-ffmpeg')
const { removeBackgroundFromImageFile } = require('remove.bg')
const imgbb = require('imgbb-uploader')
const lolis = require('lolis.life')
const loli = new lolis()
const speed = require('performance-now')
const cd = 4.32e+7
const crypto = require('crypto')
const qrcode = require("qrcode-terminal")
const axios = require('axios')
const lolcatjs = require('lolcatjs')
const figlet = require('figlet')
// Load Json File
const welkom = JSON.parse(fs.readFileSync('./database/json/welkom.json'))
const nsfw = JSON.parse(fs.readFileSync('./database/json/nsfw.json'))
const samih = JSON.parse(fs.readFileSync('./database/json/simi.json'))
const _leveling = JSON.parse(fs.readFileSync('./database/json/leveling.json'))
const _level = JSON.parse(fs.readFileSync('./database/json/level.json'))
const event = JSON.parse(fs.readFileSync('./database/json/event.json'))
const _limit = JSON.parse(fs.readFileSync('./database/json/limit.json'))
const uang = JSON.parse(fs.readFileSync('./database/json/uang.json'))
const _registered = JSON.parse(fs.readFileSync('./database/json/registered.json'))
const antilink = JSON.parse(fs.readFileSync('./database/json/antilink.json'))
// Load options file
const option = JSON.parse(fs.readFileSync('./options/option.json'))
const { ind } = require('./options/language')
const { eng } = require('./options/language')
const {
botName,
ownerName,
BarBarKey,
TobzApi,
ZeksApi,
TechApi,
ownerNumbers,
languages,
botPrefix,
memberLimitss,
userDefaultLimit
} = option
// Load Menu File
const { help } = require('./database/menu/help')
const { logomaker } = require('./database/menu/logomaker')
const { adult } = require('./database/menu/adult')
const { downloader } = require('./database/menu/downloader')
const { education } = require('./database/menu/education')
const { fun } = require('./database/menu/fun')
const { group } = require('./database/menu/group')
const { imagemaker } = require('./database/menu/imagemaker')
const { information } = require('./database/menu/information')
const { islam } = require('./database/menu/islam')
const { kerang } = require('./database/menu/kerang')
const { meme } = require('./database/menu/meme')
const { music } = require('./database/menu/music')
const { spam } = require('./database/menu/spam')
const { other } = require('./database/menu/other')
const { owner } = require('./database/menu/owner')
const { search } = require('./database/menu/search')
const { sound } = require('./database/menu/sound')
const { stalk } = require('./database/menu/stalk')
const { stayonscreen } = require('./database/menu/stayonscreen')
const { stickermaker } = require('./database/menu/stickermaker')
const { tod } = require('./database/menu/tod')
const { wibu } = require('./database/menu/wibu')
const { xp } = require('./database/menu/xp')
const { limit } = require('./database/menu/limit')
// Load Vcard Contact
const vcard = 'BEGIN:VCARD\n' // metadata of the contact card
+ 'VERSION:3.0\n'
+ 'FN:Muhammad Iqbal\n' // full name
+ 'ORG:Owner JINGAN BOT;\n' // the organization of the contact
+ 'TEL;type=CELL;type=VOICE;waid=6285745376798:+62 857-4537-6798\n' //Nomor whatsapp kamu
+ 'END:VCARD'
prefix = botPrefix
blocked = []
limitawal = userDefaultLimit
cr = '*Verified*'
memberlimit = memberLimitss
// Functions
const getLevelingXp = (userId) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].jid === userId) {
position = i
}
})
if (position !== false) {
return _level[position].xp
}
}
const getLevelingLevel = (userId) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].jid === userId) {
position = i
}
})
if (position !== false) {
return _level[position].level
}
}
const getLevelingId = (userId) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].jid === userId) {
position = i
}
})
if (position !== false) {
return _level[position].jid
}
}
const addLevelingXp = (userId, amount) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].jid === userId) {
position = i
}
})
if (position !== false) {
_level[position].xp += amount
fs.writeFileSync('./database/json/level.json', JSON.stringify(_level))
}
}
const addLevelingLevel = (userId, amount) => {
let position = false
Object.keys(_level).forEach((i) => {
if (_level[i].jid === userId) {
position = i
}
})
if (position !== false) {
_level[position].level += amount
fs.writeFileSync('./database/json/level.json', JSON.stringify(_level))
}
}
const addLevelingId = (userId) => {
const obj = {jid: userId, xp: 1, level: 1}
_level.push(obj)
fs.writeFileSync('./database/json/level.json', JSON.stringify(_level))
}
const getLimit = (sender) => {
let position = false
Object.keys(limit).forEach ((i) => {
if (limit[position].id === sender) {
position = i
}
})
if (position !== false) {
return limit[position].limit
}
}
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/json/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
}
const addATM = (sender) => {
const obj = {id: sender, uang : 0}
uang.push(obj)
fs.writeFileSync('./database/json/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/json/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/json/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/json/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/json/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) + ':' + pad(minutes) + ':' + pad(seconds)
return `${pad(hours)} Jam ${pad(minutes)} Menit ${pad(seconds)} Detik`
}
async function starts() {
const iqbal = new WAConnection()
iqbal.logger.level = 'warn'
iqbal.on('qr', () => {
console.log(color('[','white'), color('!','red'), color(']','white'), color(' Buru scan QR nya tod'))
})
fs.existsSync('./Iqbal.json') && iqbal.loadAuthInfo('./Iqbal.json')
iqbal.on('connecting', () => {
start('2', 'Connecting...')
})
iqbal.on('open', () => {
success('2', '[KONTOL] BOT UDAH AKTIF NGENTOD!')
})
await iqbal.connect({timeoutMs: 30*1000})
fs.writeFileSync('./Iqbal.json', JSON.stringify(iqbal.base64EncodedAuthInfo(), null, '\t'))
console.log('=> Sabar tod gw load/save dulu!')
lolcatjs.fromString('[DEV] Welcome back Owner Bangsat! Semoga lu dapet hidayah jangan nonton bokep mulu')
iqbal.on('group-participants-update', async (anu) => {
if (!welkom.includes(anu.jid)) return
try {
const mdata = await iqbal.groupMetadata(anu.jid)
console.log(anu)
if (anu.action == 'add') {
num = anu.participants[0]
try {
ppimg = await iqbal.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 Ngentoters @${num.split('@')[0]}\nSelamat datang di group *${mdata.subject}*`
let buff = await getBuffer(ppimg)
iqbal.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
} else if (anu.action == 'remove') {
num = anu.participants[0]
try {
ppimg = await iqbal.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 = `Mari sama kita bacakan Al-Fatihah buat yg keluar keluar semoga tenang disana @${num.split('@')[0]}👋`
let buff = await getBuffer(ppimg)
iqbal.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
}
} catch (e) {
console.log('Error : %s', color(e, 'red'))
}
})
iqbal.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'))
}
})
iqbal.on('chat-update', async (mek) => {
try {
if (!mek.hasNewMessage) return
mek = JSON.parse(JSON.stringify(mek)).messages[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();
const date = moment.tz('Asia/Jakarta').format('DD,MM,YY')
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 messagesC = pes.slice(0).trim().split(/ +/).shift().toLowerCase()
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const tescuk = ["0@s.whatsapp.net"]
const q = args.join(' ')
mess = {
wait: '⌛ Sedang di Prosess Sabar yaa Ngentod⌛',
succsess: '✔️ Berhasil ✔️',
levelon: '❬ ✔ ❭ *leveling diaktifkan*',
levelnoton: `❬ X ❭ *leveling di nonaktifkan*`,
levelnol: '*NGENTOD LEVEL LU MASIH* 0 °-°',
error: {
stick: '[❗] Gagal tod, terjadi kesalahan saat pengubahan gambar ke sticker❌',
Iv: '❌ Link nya gk valid ngentod ❌',
},
only: {
group: '[❗] SUMPAH LU TOLOL BET ANJINK, INI KHUSUS DI GRUP ANJINK ❌',
ownerG: `[❗] Lu bukan owner grup ngentod! ❌`,
admin: `[❗] Ehh... Anjink, lu itu cuma member jadi jangan sok keras yaa Ngentod ❌`,
Badmin: `[❗] Jadiin gw admin dulu lah ngentod! ❌`,
daftarB: `──「 BELUM REGISTER 」──\nHalo Ngentoters !\nLu kan belum Register nih tod, mending lu register dulu dahh... \n\nCommand : ${prefix}register nama|umur\nContoh : ${prefix}register Iqbal|17`,
}
}
const apakah = ['Iya','Tidak','Mungkin','Mungkin iya','Mungkin tidak','Coba tanyakan lagi','Tidak mungkin','Coba tanyakan lagi']
const bolehkah = ['Boleh','Tidak boleh','Iya','Sangat di anjurkan','Tidak','Mingkin','Mungkin tidak','Jangan','Tentu saja','Coba tanyakan lagi']
const kapankah = ['Hari Lagi','Minggu Lagi','Bulan Lagi','Tahun Lagi']
const botNumber = iqbal.user.jid
const ownerNumber = [ownerNumbers]
const nomorOwner = [ownerNumbers]
const isGroup = from.endsWith('@g.us')
const totalchat = await iqbal.chats.all()
const sender = isGroup ? mek.participant : mek.key.remoteJid
const groupMetadata = isGroup ? await iqbal.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupId = isGroup ? groupMetadata.jid : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupAdmins = isGroup ? getGroupAdmins(groupMembers) : ''
const isBotGroupAdmins = groupAdmins.includes(botNumber) || 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 isLevelingOn = isGroup ? _leveling.includes(groupId) : false
const NomerOwner = '6285745376798@s.whatsapp.net'
const isEventon = isGroup ? event.includes(from) : false
const isRegister = checkRegisteredUser(sender)
const isAntiLink = isGroup ? antilink.includes(from) : false
pushname = iqbal.contacts[sender] != undefined ? iqbal.contacts[sender].vname || iqbal.contacts[sender].notify : undefined
const hob =[
'Memasak','Membantu Atok','Mabar','Ngentotin Anak Orang','Nobar','Sosmed an','Sering Coli/Colmek','Gay/Lesbi/LGBT','Membantu Orang lain','Nonton Anime','Nonton Drakor','Cekek Batang/Colok Memek','Naik Motor','Nyanyi','Menari','Bertumbuk','Menggambar','Foto fotoan Ga jelas','Suka Merkosain Anak Orang','Maen Game','Berbicara Sendiri','Entod Emak Sendiri'
]
const wa =[
'penyayang','pemurah','Pemarah','Pemaaf','Penurut','Baik','baperan','Baik Hati','penyabar','Uwu','top deh, pokoknya','Suka Membantu'
]
var persengayy = [
`*4%*\n\n*Tobat Ngegay Gan:v*`,`*9%*\n\n*OTW Tobat Gan:v*`,`*17%*\n\n*Kang Coli*`,`*28%*\n\n*Buset Dah Gay🤦*`,`*34%*\n\n *Korban Tusbol*`,`*48%*\n\n*Kang Hunter Bool:v*`,`*59%*\n\n *Bahaya Ni Orang Gan*`,`*62%*\n\n*Hati" Sama Ni Orang Beneran Dah*`,`*74%*\n\n*Astagfirullah Kabur Gan🏃🌬️*`,`83%\n\n Yaallah Nak 🤦`,`97%\n\nAstagfirullah🤦`,`100%\n\nKabur ae Gan Daripada Ditusbol Bool lu🏃`,`29%\n\n amann:v`,`94%\n\n Yaallah Banyak bet gay🏃`,`75%\n\nHadehh Gay🤦`,`82%\n\nMending Lu Tobat Dah🏃`,`41%\n\nSering Cari Bool Diperempatan`,`39%\n\nSering Tusbol Bool Topan🏃`
]
var persenbucin = [
`4%\n\nHadehh🤦`,`9%\n\nMasih Kecil Dah Bucin Ae`,`17%\n\nNakk Masih Kecil`,`28%\n\nYoalahh hmm`,`34%\n\nMayan Lah`,`48%\n\nGatau`,`59%\n\nBiasa Kang Bucin`,`62%\n\n Hadehhh🏃`,`74%\n\n Bucen Teroosss`,`83%\n\n Sekali" kek Ga bucin Gitu`,`97%\n\nHadehh Pakboi"`,`100%\n\nHadehhh Ini Bukan Bucin Tapi Pakboi`,`29%\n\nKasian Mana Masih Muda`,`94%\n\n Dasar Pakboi`,`75%\n\n Ya Ampun`
]
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) => {
iqbal.sendMessage(from, teks, text, {quoted:mek})
}
const sendMess = (hehe, teks) => {
iqbal.sendMessage(hehe, teks, text)
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? iqbal.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : iqbal.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": memberr}})
}
const sendImage = (teks) => {
iqbal.sendMessage(from, teks, image, {quoted:mek})
}
const costum = (pesan, tipe, target, target2) => {
iqbal.sendMessage(from, pesan, tipe, {quoted: { key: { fromMe: false, participant: `${target}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target2}` }}})
}
const sendPtt = (teks) => {
iqbal.sendMessage(from, audio, mp3, {quoted:mek})
}
//function leveling
if (isGroup && 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❑ *Name*: ${sender}\n❑ *XP*: ${getLevelingXp(sender)}\n❑ *Level*: ${getLevel} -> ${getLevelingLevel(sender)}\n\nCongrats!! 🥳🎉`)
}
} catch (err) {
console.error(err)
}
}
//function check limit
const checkLimit = (sender) => {
let found = false
for (let lmt of _limit) {
if (lmt.id === sender) {
limitCounts = limitawal - lmt.limit
if (limitCounts <= 0) return iqbal.sendMessage(from,`Limit request anda sudah habis\n\n_Note : Limit akan direset setiap jam 21:00!_`, text,{ quoted: mek})
iqbal.sendMessage(from, ind.limitcount(limitCounts), text, { quoted : mek})
found = true
}
}
if (found === false) {
let obj = { id: sender, limit: 1 }
_limit.push(obj)
fs.writeFileSync('./database/json/limit.json', JSON.stringify(_limit))
iqbal.sendMessage(from, ind.limitcount(limitCounts), text, { quoted : mek})
}
}
//funtion limited
const isLimit = (sender) =>{
let position = false
for (let i of _limit) {
if (i.id === sender) {
let limits = i.limit
if (limits >= limitawal ) {
position = true
iqbal.sendMessage(from, ind.limitend(pushname), text, {quoted: mek})
return true
} else {
_limit
position = true
return false
}
}
}
if (position === false) {
const obj = { id: sender, limit: 1 }
_limit.push(obj)
fs.writeFileSync('./database/json/limit.json',JSON.stringify(_limit))
return false
}
}
if (isGroup) {
try {
const getmemex = groupMembers.length
if (getmemex <= memberlimit) {
iqbal.groupLeave(from)
}
} catch {
console.error(err)
}
}
//function balance
if (isRegister && isGroup ) {
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 (messagesC.includes("://chat.whatsapp.com/")){
if (!isGroup) return
if (!isAntiLink) return
if (isGroupAdmins) return reply('Untung lu admin grup jadi gk gw kick, coba klo lu member udah gw kick lu anjink')
iqbal.updatePresence(from, Presence.composing)
if (messagesC.includes("#izinadmin")) return reply("#izinadmin diterima")
var kic = `${sender.split("@")[0]}@s.whatsapp.net`
reply(`Link Group Terdeteksi Yahaha Mampus lu ${sender.split("@")[0]} Lu bakal gw kick dari group 5detik lagi`)
setTimeout( () => {
iqbal.groupRemove(from, [kic]).catch((e)=>{reply(`*ERR:* ${e}`)})
}, 5000)
setTimeout( () => {
iqbal.updatePresence(from, Presence.composing)
reply("1detik")
}, 4000)
setTimeout( () => {
iqbal.updatePresence(from, Presence.composing)
reply("2detik")
}, 3000)
setTimeout( () => {
iqbal.updatePresence(from, Presence.composing)
reply("3detik")
}, 2000)
setTimeout( () => {
iqbal.updatePresence(from, Presence.composing)
reply("4detik")
}, 1000)
setTimeout( () => {
iqbal.updatePresence(from, Presence.composing)
reply("5detik")
}, 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))
// Load Commands
switch(command) {
case 'help':
case 'menu':
if (!isRegister) return reply(mess.only.daftarB)
const reqXp = 5000 * (Math.pow(2, getLevelingLevel(sender)) - 1)
const uangku = checkATMuser(sender)
await costum(help(pushname, prefix, botName, ownerName, reqXp, uangku), text, tescuk, cr)
break
case '18+menu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(adult(prefix, botName, ownerName), text, tescuk, cr)
break
case 'downloadermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(downloader(prefix, botName, ownerName), text, tescuk, cr)
break
case 'educationmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(education(prefix, botName, ownerName), text, tescuk, cr)
break
case 'funmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(fun(prefix, botName, ownerName), text, tescuk, cr)
break
case 'groupmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(group(prefix, botName, ownerName), text, tescuk, cr)
break
case 'imagemakermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(imagemaker(prefix, botName, ownerName), text, tescuk, cr)
break
case 'informationmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(information(prefix, botName, ownerName), text, tescuk, cr)
break
case 'islammenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(islam(prefix, botName, ownerName), text, tescuk, cr)
break
case 'kerangmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(kerang(prefix, botName, ownerName), text, tescuk, cr)
break
case 'logomakermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(logomaker(prefix, botName, ownerName), text, tescuk, cr)
break
case 'mememenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(meme(prefix, botName, ownerName), text, tescuk, cr)
break
case 'musicmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(music(prefix, botName, ownerName), text, tescuk, cr)
break
case 'spammenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(spam(prefix, botName, ownerName), text, tescuk, cr)
break
case 'othermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(other(prefix, botName, ownerName), text, tescuk, cr)
break
case 'ownermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(owner(prefix, botName, ownerName), text, tescuk, cr)
break
case 'searchmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(search(prefix, botName, ownerName), text, tescuk, cr)
break
case 'soundmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(sound(prefix, botName, ownerName), text, tescuk, cr)
break
case 'stalkmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(stalk(prefix, botName, ownerName), text, tescuk, cr)
break
case 'stayonscreenmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(stayonscreen(prefix, botName, ownerName), text, tescuk, cr)
break
case 'stickermakermenu':
case 'stikermakermenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(stickermaker(prefix, botName, ownerName), text, tescuk, cr)
break
case 'todmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(tod(prefix, botName, ownerName), text, tescuk, cr)
break
case 'wibumenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(wibu(prefix, botName, ownerName), text, tescuk, cr)
break
case 'xpmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(xp(prefix, botName, ownerName), text, tescuk, cr)
break
case 'limitmenu':
if (!isRegister) return reply(mess.only.daftarB)
await costum(limit(prefix, botName, ownerName), text, tescuk, cr)
break
case 'timer':
if (args[1]=="detik") {var timer = args[0]+"000"
} else if (args[1]=="menit") {var timer = args[0]+"0000"
} else if (args[1]=="jam") {var timer = args[0]+"00000"
} else {return reply("*pilih:*\ndetik\nmenit\njam")}
setTimeout( () => {
reply("Waktu habis")
}, timer)
break
case 'bahasa':
iqbal.sendMessage(from, bahasa(prefix, sender), text, {quoted: mek})
break
case 'virtex':
iqbal.sendMessage(from, virtex(prefix, sender), text, {quoted: mek})
break
case 'virtex2':
iqbal.sendMessage(from, virtex2(prefix, sender), text, {quoted: mek})
break
case 'donasi':
case 'donate':
iqbal.sendMessage(from, donasi(prefix, sender), text, {quoted: mek})
break
case 'kodenegara':
iqbal.sendMessage(from, negara(prefix, sender), text, {quoted: mek})
break
case 'demote':
if (!isGroup) return reply(mess.only.group)
if (!isGroupAdmins) return reply(mess.only.admin)
if (!isBotGroupAdmins) return reply(mess.only.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)
iqbal.groupDemoteAdmin(from, mentioned)
} else {
mentions(`𝐏𝐞𝐫𝐢𝐧𝐭𝐚𝐡 𝐝𝐢𝐭𝐞𝐫𝐢𝐦𝐚, 𝐦𝐞𝐧𝐮𝐫𝐮𝐧𝐤𝐚𝐧 @${mentioned[0].split('@')[0]}\n 𝐣𝐚𝐝𝐢 𝐚𝐝𝐦𝐢𝐧 𝐠𝐫𝐨𝐮𝐩 _*${groupMetadata.subject}*_`, mentioned, true)
iqbal.groupDemoteAdmin(from, mentioned)
}
break
case 'randomhentai':
gatauda = body.slice(6)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
reply(mess.wait)
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/hentai?apikey=BotWeA`, {method: 'get'})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, image, {quoted: mek})
await limitAdd(sender)
break
case 'loli':
gatauda = body.slice(6)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
reply(mess.wait)
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/randomloli?apikey=BotWeA`, {method: 'get'})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, image, {quoted: mek})
await limitAdd(sender)
break
case 'promote':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (!isGroup) return reply(mess.only.group)
if (!isGroupAdmins) return reply(mess.only.admin)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di promote!')
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
if (mentioned.length > 1) {
teks = 'Perintah di terima, menambah jabatan sebagai admin :\n'
for (let _ of mentioned) {
teks += `@${_.split('@')[0]}\n`
}
mentions(teks, mentioned, true)
iqbal.groupMakeAdmin(from, mentioned)
} else {
mentions(`Perintah di terima, menambah jabatan sebagai admin : @${mentioned[0].split('@')[0]}`, mentioned, true)
iqbal.groupMakeAdmin(from, mentioned)
}
break
case 'wa.me':
case 'wame':
iqbal.updatePresence(from, Presence.composing)
options = {
text: `「 *SELF WHATSAPP* 」\n\n_Request by_ : *@${sender.split("@s.whatsapp.net")[0]}\n\nYour link WhatsApp : *wa.me/${sender.split("@s.whatsapp.net")[0]}*\n*Or ( / )*\n*api.whatsapp.com/send?phone=${sender.split("@")[0]}*`,
contextInfo: { mentionedJid: [sender] }
}
iqbal.sendMessage(from, options, text, { quoted: mek } )
break
if (data.error) return reply(data.error)
reply(data.result)
break
case 'quotes':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
data = await fetchJson(`http://mhankbarbars.herokuapp.com/api/randomquotes`)
ez = `*➸ Author :* ${data.author}\n*➸ Quotes :* ${data.quotes}`
reply(ez)
await limitAdd(sender)
break
case '3dtext':
data = await await getBuffer(`https://docs-jojo.herokuapp.com/api/text3d?text=${body.slice(8)}`)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
iqbal.sendMessage(from, data, image, {quoted: mek, caption: body.slice(8)})
await limitAdd(sender)
break
case 'fml':
data = await fetchJson(`https://docs-jojo.herokuapp.com/api/fml`)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
hasil = data.result.fml
reply(hasil)
await limitAdd(sender)
break
case 'owner':
case 'creator':
iqbal.sendMessage(from, {displayname: "Jeff", vcard: vcard}, MessageType.contact, { quoted: mek})
iqbal.sendMessage(from, 'Nih nomor owner gw tod, save ya anjink nanti di save balik',MessageType.text, { quoted: mek} )
break
case 'hidetag':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (!isGroup) return reply(langss.group())
teks = body.slice(9)
group = await iqbal.groupMetadata(from);
member = group['participants']
jids = [];
member.map( async adm => {
jids.push(adm.id.replace('c.us', 's.whatsapp.net'));
})
options = {
text: teks,
contextInfo: {mentionedJid: jids},
quoted: mek
}
await iqbal.sendMessage(from, options, text)
break
case 'tiktokstalk':
try {
if (args.length < 1) return iqbal.sendMessage(from, 'Usernamenya mana tod? ', text, {quoted: mek})
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
let { user, stats } = await tiktod.getUserProfileInfo(args[0])
reply(mess.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)
iqbal.sendMessage(from, buffer, image, {quoted: mek, caption: teks})
await limitAdd(sender)
} catch (e) {
console.log(`Error :`, color(e,'red'))
reply('username nya gk valid asu')
}
break
case 'snowwrite':
var gh = body.slice(11)
var gbl7 = gh.split("|")[0];
var gbl8 = gh.split("|")[1];
if (args.length < 1) return reply(`Kirim perintah ${prefix}snowwrite teks1|teks2, contoh ${prefix}snowwrite iqbal|ganss`)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
reply(mess.wait)
anu = await fetchJson(`https://zeksapi.herokuapp.com/api/snowwrite?text1=${gbl7}&text2=${gbl8}&apikey=apivinz`, {method: 'get'})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, image, {quoted: mek})
await limitAdd(sender)
break
case 'marvellogo':
var gh = body.slice(12)
if (args.length < 1) return reply(`Kirim perintah ${prefix}marvellogo teks, contoh ${prefix}marvellogo Iqbal Ganss`)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
reply(mess.wait)
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/textpro?theme=snow&text=${gh}&apikey=BotWeA`, {method: 'get'})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, image, {quoted: mek})
await limitAdd(sender)
break
case 'artinama':
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
if (args.length < 1) return reply('Apa yang mau dicari ngentod?')
anu = await fetchJson(`https://mnazria.herokuapp.com/api/arti?nama=${body.slice(6)}`, {method: 'get'})
reply('Menurut nama:\n\n'+anu.result)
await limitAdd(sender)
break
case 'infonomor':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
if (args.length < 1) return reply(`Masukan Nomor\nContoh : ${prefix}infonomor 0812345678`)
data = await fetchJson(`https://docs-jojo.herokuapp.com/api/infonomor?no=${body.slice(11)}`)
if (data.error) return reply(data.error)
if (data.result) return reply(data.result)
hasil = `╠➥ internasional : ${data.international}\n╠➥ nomor : ${data.nomor}\n╠➥ operator : ${data.op}`
reply(hasil)
await limitAdd(sender)
break
case 'map':
data = await fetchJson(`https://mnazria.herokuapp.com/api/maps?search=${body.slice(5)}`)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
hasil = await getBuffer(data.gambar)
iqbal.sendMessage(from, hasil, image, {quoted: mek, caption: `Hasil Dari *${body.slice(5)}*`})
await limitAdd(sender)
break
case 'covidcountry':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
data = await fetchJson(`https://api.arugaz.my.id/api/edu/corona?country=${body.slice(7)}`)
if (data.result) reply(data.result)
hasil = `Negara : ${data.result.country}\n\nActive : ${data.result.active}\ncasesPerOneMillion : ${data.result.casesPerOneMillion}\ncritical : ${data.result.critical}\ndeathsPerOneMillion : ${data.result.deathsPerOneMillion}\nrecovered : ${data.result.recovered}\ntestPerOneMillion : ${data.result.testPerOneMillion}\ntodayCases : ${data.result.todayCases}\ntodayDeath : ${data.result.todayDeath}\ntotalCases : ${data.result.totalCases}\ntotalTest : ${data.result.totalTest}`
reply(hasil)
await limitAdd(sender)
break
case 'wiki':
if (args.length < 1) return reply('masukan kata kunci nya tod')
tels = body.slice(6)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/wiki?q=${tels}&apikey=BotWeA`, {method: 'get'})
reply(anu.result)
await limitAdd(sender)
break
case 'wikien':
if (args.length < 1) return reply('masukan kata kunci nya tod')
tels = body.slice(8)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
anu = await fetchJson(`https://arugaz.herokuapp.com/api/edu/enwiki?query=${tels}`, {method: 'get'})
reply(anu.result)
await limitAdd(sender)
break
case 'ytmp3':
if (args.length < 1) return reply('Urlnya mana ngentod?')
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)
anu = await fetchJson(`https://mhankbarbar.tech/api/yta?url=${args[0]}&apiKey=${BarBarKey}`, {method: 'get'})
if (anu.error) return reply(anu.error)
teks = `❏ *Title* : ${anu.title}\n❏ *Filesize* : ${anu.filesize}\n\nTunggu Bentar Ya Tod, Audionya Lagi Di Kirim...`
thumb = await getBuffer(anu.thumb)
iqbal.sendMessage(from, thumb, image, {quoted: mek, caption: teks})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, audio, {mimetype: 'audio/mp4', filename: `${anu.title}.mp3`, quoted: mek})
await limitAdd(sender)
break
case 'ytmp4':
if (args.length < 1) return reply('Urlnya mana ngentod?')
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)
anu = await fetchJson(`https://mhankbarbar.tech/api/ytv?url=${args[0]}&apiKey=${BarBarKey}`, {method: 'get'})
if (anu.error) return reply(anu.error)
teks = `❏ *Title* : ${anu.title} \n❏ *Size* : ${anu.filesize} \n❏ *Desc* : ${anu.desc} \n\n*VIDEO SEDANG DIKIRIMKAN, JANGAN SPAM YA NGENTOD...*`
thumb = await getBuffer(anu.thumb)
iqbal.sendMessage(from, thumb, image, {quoted: mek, caption: teks})
buffer = await getBuffer(anu.result)
iqbal.sendMessage(from, buffer, video, {mimetype: 'video/mp4', filename: `${anu.title}.mp4`, quoted: mek})
await limitAdd(sender)
break
case 'trendtwit':
iqbal.updatePresence(from, Presence.composing)
if (!isRegister) return reply(mess.only.daftarB)
if (isLimit(sender)) return reply(ind.limitend(pusname))
data = await fetchJson(`https://docs-jojo.herokuapp.com/api/trendingtwitter`, {method: 'get'})
teks = '=================\n'
for (let i of data.result) {
teks += `*Hastag* : ${i.hastag}\n*link* : ${i.link}\n*rank* : ${i.rank}\n*Tweet* : ${i.tweet}\n=================\n`
}
reply(teks.trim())
await limitAdd(sender)
break
case 'testime':
setTimeout( () => {
iqbal.sendMessage(from, 'Waktu habis:v', text) // ur cods
}, 10000) // 1000 = 1s,
setTimeout( () => {
iqbal.sendMessage(from, '5 Detik lagi', text) // ur cods
}, 5000) // 1000 = 1s,
setTimeout( () => {
iqbal.sendMessage(from, '10 Detik lagi', text) // ur cods