generated from Fxc7/termux-bot-wa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fxc7.js
3236 lines (3166 loc) · 169 KB
/
Fxc7.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
/*
* Tambahin nama author lah
* Author MhankBarBar, Farhan
* Tambahin ya Cape Gan ngefix² Yg Ga work
* Jan numpang nama doank
- What's New?
* New Features
*/
// KALO NGUBAH YG TELITI NTAR GA WORK MALAH NYALAHIN HADEHH
// DAN YG NYURI TANPA KASIH CREDIT INGAT BRO LU SAMPAH🚮
const {
WAConnection,
MessageType,
Presence,
Mimetype,
GroupSettingChange
} = require('@adiwajshing/baileys')
const fs = require("fs")
const axios = require('axios')
const request = require('request')
const moment = require('moment-timezone')
const { exec } = require('child_process')
const fetch = require('node-fetch')
const tiktod = require('tiktok-scraper')
const ffmpeg = require('fluent-ffmpeg')
const google = require('google-it')
const imageToBase64 = require('image-to-base64')
const speed = require('performance-now')
const imgbb = require('imgbb-uploader')
const { removeBackgroundFromImageFile } = require('remove.bg')
const brainly = require('brainly-scraper')
const cd = 4.32e+7
const lolis = require('lolis.life')
const loli = new lolis()
const { BarBarApi, ZeksApi, TechApi, TobzApi, VthearApi } = JSON.parse(fs.readFileSync('./database/json/apikey.json'))
const setting = JSON.parse(fs.readFileSync('./database/json/setting.json'))
const welkom = JSON.parse(fs.readFileSync('./database/json/welkom.json'))
const nsfw = JSON.parse(fs.readFileSync('./database/json/nsfw.json'))
const _limit = JSON.parse(fs.readFileSync('./database/json/limit.json'))
const samih = JSON.parse(fs.readFileSync('./database/json/simi.json'))
const user = JSON.parse(fs.readFileSync('./database/json/user.json'))
const publik = JSON.parse(fs.readFileSync('./database/json/public.json'))
const bucinrandom = JSON.parse(fs.readFileSync('./database/json/bucin.json'))
const hekerbucin = JSON.parse(fs.readFileSync('./database/json/hekerbucin.json'))
const katailham = JSON.parse(fs.readFileSync('./database/json/katailham.json'))
const adminNumber = JSON.parse(fs.readFileSync('./database/json/admin.json'))
const anime = JSON.parse(fs.readFileSync('./database/json/anime.json'))
const blocked = JSON.parse(fs.readFileSync('./database/json/blocked.json'))
const antilink = JSON.parse(fs.readFileSync('./database/json/antilink.json'))
let {
instagram, yt, groupLink
} = setting
const { fetchJson } = require('./lib/fetcher')
const { recognize } = require('./lib/ocr')
const { color, bgcolor } = require('./lib/color')
const { help, bahasa, donasi, limitend, limitcount, bottt } = require('./Fxc7/help')
const { wait, simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('./lib/functions')
const vcard = 'BEGIN:VCARD\n'
+ 'VERSION:3.0\n'
+ 'FN:Farhan\n'
+ 'ORG:Owner FXC7;\n'
+ 'TEL;type=CELL;type=VOICE;waid=628311800241:+62 831-1800-241\n'
+ 'END:VCARD'
prefix = "!"
name = "~ IRIENE BOT"
rdaftar = "TERIMA KASIH TELAH DAFTAR MENJADI TEMEN IRIENEBOT😁"
rmenu = "HAI TEMEN IRIENEBOT👋 JANGAN LUPA DONASI YAA:)"
botinfo = "UNTUK INVITE BOT SILAHKAN DONASI DULU YAA:)"
limitt = 10
memberLimit = 2
ban = []
premium = ["[email protected]"]
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`
}
async function starts() {
const frhan = new WAConnection()
frhan.logger.level = 'warn'
console.log(banner.string)
frhan.on('qr', () => {
console.log(color('[','red'), color('!','yellow'), color(']','red'), color(' Scan the qr code above', 'green'))
})
fs.existsSync('./Fxc7.json') && frhan.loadAuthInfo('./Fxc7.json')
frhan.on('connecting', () => {
start('2', 'Connecting...')
})
frhan.on('open', () => {
success('2', 'Connected')
})
await frhan.connect({timeoutMs: 30*1000})
fs.writeFileSync('./Fxc7.json', JSON.stringify(frhan.base64EncodedAuthInfo(), null, '\t'))
frhan.on('group-participants-update', async (anu) => {
if (!welkom.includes(anu.jid)) return
try {
const mdata = await frhan.groupMetadata(anu.jid)
console.log(anu)
if (anu.action == 'add') {
num = anu.participants[0]
try {
ppimg = await frhan.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 = `Halo @${num.split('@')[0]}\nSelamat datang di group *${mdata.subject}*`
let buff = await getBuffer(ppimg)
frhan.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
} else if (anu.action == 'remove') {
num = anu.participants[0]
try {
ppimg = await frhan.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 = `Sayonara @${num.split('@')[0]} IRENE MISS YOU:D`
let buff = await getBuffer(ppimg)
frhan.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})
}
} catch (e) {
console.log('Error : %s', color(e, 'yellow'))
}
})
frhan.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'))
}
})
frhan.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 FarhanGans = ["[email protected]"] // ubah aja gapapa
const farhan = mek.message.conversation
const insom = from.endsWith('@g.us')
const nameReq = insom ? mek.participant : mek.key.remoteJid
pushname2 = frhan.contacts[nameReq] != undefined ? frhan.contacts[nameReq].vname || frhan.contacts[nameReq].notify : undefined
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const date = new Date().toLocaleDateString()
const time = moment.tz('Asia/Jakarta').format('HH:mm:ss')
const jam = moment.tz('Asia/Jakarta').format('HH:mm')
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 Link = (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 messagesLink = Link.slice(0).trim().split(/ +/).shift().toLowerCase()
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const Far = args.join(' ')
const isCmd = body.startsWith(prefix)
frhan.chatRead(from)
mess = {
wait: '*⏳ ᴡᴀɪᴛ ꜱᴇᴅᴀɴɢ ᴅɪ ᴩʀᴏꜱᴇꜱ...*',
success: '*ꜱᴜᴋꜱᴇꜱ...*',
error: {
stick: ' *ɢᴀɢᴀʟ, ᴛᴇʀᴊᴀᴅɪ ᴋᴇꜱᴀʟᴀʜᴀɴ ꜱᴀᴀᴛ ᴍᴇɴɢᴋᴏɴᴠᴇʀꜱɪ ɢᴀᴍʙᴀʀ ᴋᴇ ꜱᴛɪᴄᴋᴇʀ*',
Iv: '*ᴍᴀᴀꜰ ʟɪɴᴋ ᴛɪᴅᴀᴋ ᴠᴀʟɪᴅ!!*'
},
only: {
group: '*ᴍᴀᴀꜰ ᴩᴇʀɪɴᴛᴀʜ ɪɴɪ ʜᴀɴyᴀ ʙɪꜱᴀ ᴅɪ ɢᴜɴᴀᴋᴀɴ ᴅᴀʟᴀᴍ ɢʀᴏᴜᴩ!*',
benned: '*ᴍᴀᴀꜰ ɴᴏᴍᴇʀ ᴋᴀᴍᴜ ᴋᴇ ʙᴀɴɴᴇᴅ ꜱɪʟᴀʜᴋᴀɴ ʜᴜʙᴜɴɢɪ ᴏᴡɴᴇʀ ᴀɢᴀʀ ᴍᴇᴍʙᴜᴋᴀ ʙᴀɴɴᴇᴅ ᴀɴᴅᴀ*',
ownerG: '*ᴍᴀᴀꜰ ᴩᴇʀɪɴᴛᴀʜ ɪɴɪ ʜᴀɴyᴀ ʙɪꜱᴀ ᴅɪ ɢᴜɴᴀᴋᴀɴ ᴏʟᴇʜ ᴏᴡɴᴇʀ ɢʀᴏᴜᴩ!*',
ownerB: '*ᴍᴀᴀꜰ ᴩᴇʀɪɴᴛᴀʜ ɪɴɪ ʜᴀɴyᴀ ʙɪꜱᴀ ᴅɪ ɢᴜɴᴀᴋᴀɴ ᴏʟᴇʜ ᴏᴡɴᴇʀ ʙᴏᴛ!* ',
premium: '*ᴍᴀᴀꜰ ꜰɪᴛᴜʀ ɪɴɪ ᴋʜᴜꜱᴜꜱ ᴜꜱᴇʀ ᴩʀᴇᴍɪᴜᴍ!!*',
userB: `Hai Kak ${pushname2} Kamu Belom Terdaftar Didatabase Silahkan Ketik \n${prefix}daftar`,
admin: '*ᴍᴀᴀꜰ ᴩᴇʀɪɴᴛᴀʜ ɪɴɪ ʜᴀɴyᴀ ʙɪꜱᴀ ᴅɪ ɢᴜɴᴀᴋᴀɴ ᴏʟᴇʜ ᴀᴅᴍɪɴ ɢʀᴏᴜᴩ!*',
Badmin: '*ᴍᴀᴀꜰ ᴩᴇʀɪɴᴛᴀʜ ɪɴɪ ʜᴀɴyᴀ ʙɪꜱᴀ ᴅɪ ɢᴜɴᴀᴋᴀɴ ᴋᴇᴛɪᴋᴀ ʙᴏᴛ ᴍᴇɴᴊᴀᴅɪ ᴀᴅᴍɪɴ!*',
publikG: `*ᴍᴀᴀꜰ ʙᴏᴛ ꜱᴇᴋᴀʀᴀɴɢ ꜱᴜᴅᴀʜ ᴅɪᴩʀɪᴠᴀᴛᴇ ᴏʟᴇʜ ᴏᴡɴᴇʀ*\n*ᴜɴᴛᴜᴋ ʟᴇʙɪʜ ᴊᴇʟᴀꜱɴyᴀ ᴋᴇᴛɪᴋ*\n*${prefix}infobot*`
}
}
const botNumber = frhan.user.jid
const ownerNumber = ["[email protected]"] // owner number ubah aja
const isGroup = from.endsWith('@g.us')
const sender = isGroup ? mek.participant : mek.key.remoteJid
const groupMetadata = isGroup ? await frhan.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 totalchat = await frhan.chats.all()
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 isAnime = isGroup ? anime.includes(from) : false
const isSimi = isGroup ? samih.includes(from) : false
const isPublic = isGroup ? publik.includes(from) : false
const isAntiLink = isGroup ? antilink.includes(from) : false
const isOwner = ownerNumber.includes(sender)
const isUser = user.includes(sender)
const isBanned = ban.includes(sender)
const isPrem = premium.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) => {
frhan.sendMessage(from, teks, text, {quoted:mek})
}
const sendMess = (hehe, teks) => {
frhan.sendMessage(hehe, teks, text)
}
const costum = (pesan, tipe, target, target2) => {
frhan.sendMessage(from, pesan, tipe, {quoted: { key: { fromMe: false, participant: `${target}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target2}` }}})
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? frhan.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : frhan.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": memberr}})
}
colors = ['red','white','black','blue','yellow','green', 'aqua']
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')
const checkLimit = (sender) => {
let found = false
for (let lmt of _limit) {
if (lmt.id === sender) {
limitCounts = limitt - lmt.limit
found = true
}
}
if (found === false) {
let obj = { id: sender, limit: 1 }
_limit.push(obj)
fs.writeFileSync('./database/json/limit.json', JSON.stringify(_limit))
frhan.sendMessage(from, limitcount(limitCounts), text, { quoted : mek})
}
}
if (isGroup) {
try {
const getmemex = groupMembers.length
if (getmemex <= memberLimit) {
frhan.sendMessage(from, `Maaf ${name} Tidak Bisa Masuk Group Karna Member Group ${groupMetadata.subject} Tidak Memenuhi Limit Member\n\nMinimal Member ${memberLimit}`, text)
frhan.groupLeave(from)
}
} catch (err) { console.error(err) }
}
const isLimit = (sender) =>{
let position = false
for (let i of _limit) {
if (i.id === sender) {
let limits = i.limit
if (limits >= limitt ) {
position = true
frhan.sendMessage(from, limitend(pushname2), 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
}
}
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))
}
}
if (messagesLink.includes("://chat.whatsapp.com/")){
if (!isGroup) return
if (!isAntiLink) return
if (isGroupAdmins) return reply(`${pushname2} Adalah Admin Group Kamu Tidak Akan Di kick`)
frhan.updatePresence(from, Presence.composing)
var Kick = `${sender.split("@")[0]}@s.whatsapp.net`
setTimeout( () => {
reply('byee👋')
}, 1100)
setTimeout( () => {
frhan.groupRemove(from, [Kick]).catch((e) => {reply(`*ERROR:* ${e}`)})
}, 1000)
setTimeout( () => {
reply(`Link Group Terdeteksi maaf *${pushname2}* anda akan di kick`)
}, 0)
}
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 'ep':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return reply('Pilih themenya gan, 1 - 162\n\nContoh Penggunaan: !tp/1/Farhan')
textpro = body.slice(4)
txtpro1 = textpro.split("/")[0];
txtpro2 = textpro.split("/")[1];
buff = await getBuffer(`https://mhankbarbar.tech/api/ephoto?pack=${txtpro1}&text=${txtpro2}&apiKey=${BarBarApi}`, {method: 'get'})
frhan.sendMessage(from, buff, image, {quoted: mek})
await limitAdd(sender)
break
case 'tp':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return reply('Pilih themenya gan, 1 - 162\n\nContoh Penggunaan: !tp/1/Farhan')
textpro = body.slice(4)
txtpro1 = textpro.split("/")[0];
txtpro2 = textpro.split("/")[1];
buff = await getBuffer(`https://mhankbarbar.tech/api/textpro?pack=${txtpro1}&text=${txtpro2}&apiKey=${BarBarApi}`, {method: 'get'})
frhan.sendMessage(from, buff, image, {quoted: mek})
await limitAdd(sender)
break
case 'brainly':
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isBanned) return reply(mess.only.benned)
if (isLimit(sender)) return reply(limitend(pushname2))
brien = body.slice(9)
brainly(`${brien}`).then(res => {
teks = '❉───────────────────────❉\n'
for (let Y of res.data) {
teks += `\n*「 _BRAINLY_ 」*\n\n*➸ Pertanyaan:* ${Y.pertanyaan}\n\n*➸ Jawaban:* ${Y.jawaban[0].text}\n❉───────────────────────❉\n`
}
frhan.sendMessage(from, teks, text, {quoted: mek, detectLinks: false})
console.log(res)
})
await limitAdd(sender)
break
case 'daftar':
frhan.updatePresence(from, Presence.composing)
if (isUser) return reply('kamu sudah Menjadi Temen IRIENEBOT:D')
if (isBanned) return reply(mess.only.benned)
user.push(sender)
fs.writeFileSync('./database/json/user.json', JSON.stringify(user))
try {
ppimg = await frhan.getProfilePicture(`${sender.split('@')[0]}@s.whatsapp.net`)
} catch {
ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'
}
captionnya = `╭─「 *PENDAFTARAN USER* 」\`\`\`\n│ Pendaftaran berhasil dengan SN: \n│ TM08GK8PPHBSJDH10J\`\`\`\n│\n│\`\`\`Pada ${date} ${time}\`\`\`\n│\`\`\`[Nama]: ${pushname2}\`\`\`\n│\`\`\`[Nomor]: wa.me/${sender.split("@")[0]}\`\`\`\n│\`\`\`Untuk menggunakan bot\`\`\`\n│\`\`\`silahkan\`\`\`\n│\`\`\`kirim ${prefix}help/menu\`\`\`\n│\`\`\`\n│Total Pengguna: ${user.length} Orang\`\`\`\n╰─────────────────────────`
daftarimg = await getBuffer(ppimg)
frhan.sendMessage(from, daftarimg, image, {quoted: mek, caption: captionnya})
break
case 'help':
case 'menu':
if (isBanned) return reply(mess.only.benned)
if (!isPublic) return reply(mess.only.publikG)
if (!isUser) return reply(mess.only.userB)
uptime = process.uptime()
user.push(sender)
myMonths = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"];
myDays = ['Minggu','Senin','Selasa','Rabu','Kamis','Jum at','Sabtu'];
var tgl = new Date();
var day = tgl.getDate()
bulan = tgl.getMonth()
var thisDay = tgl.getDay(),
thisDay = myDays[thisDay];
var yy = tgl.getYear()
var year = (yy < 1000) ? yy + 1900 : yy;
const tanggal = `${thisDay}, ${day} - ${myMonths[bulan]} - ${year}`
await costum(help(prefix, instagram, yt, name, pushname2, user, limitt, uptime, jam, tanggal), text, FarhanGans, rmenu)
break
case 'infobot':
await costum(bottt(prefix), text, FarhanGans, botinfo)
break
case 'profile':
frhan.updatePresence(from, Presence.composing)
if (!isPublic) return reply(mess.only.publikG)
if (!isUser) return reply(mess.only.userB)
if (isBanned) return reply(mess.only.benned)
try {
profil = await frhan.getProfilePicture(`${sender.split('@')[0]}@s.whatsapp.net`)
} catch {
profil = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'
}
profile = `╭─「 *PROFILE ANDA* 」\n│• *Name:* ${pushname2}\n│• *User Terdaftar:* ✅\n│• *Link:* wa.me/${sender.split("@")[0]}\n╰─────────────────────`
buff = await getBuffer(profil)
frhan.sendMessage(from, buff, image, {quoted: mek, caption: profile})
break
case 'bahasa':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
frhan.sendMessage(from, bahasa(prefix), text, {quoted: mek})
break
case 'donasi':
case 'donate':
frhan.sendMessage(from, donasi(name), text, {quoted: mek})
break
case 'info':
me = frhan.user
user.push(sender)
uptime = process.uptime()
teks = `➽ *Nama Bot* : ${me.name}\n➽ *Owner Bot* : @${ownerNumber}\n➽ *prefix* : | ${prefix} |\n➽ *Total Block* : ${blocked.length}\n➽ *Aktif Sejak* : ${kyun(uptime)}\n\n➽ *Total Pengguna* : ${user.length} User\n➽ *Instagram* : https://www.instagram.com/_farhan_xcode7\n➽ *Special Thanks To* :\n\n➽ Allah SWT \n➽ MhankBarBar\n➽ Nurutomo\n➽ Monurios`
buffer = await getBuffer(me.imgUrl)
frhan.sendMessage(from, buffer, image, {quoted: mek, caption: teks, contextInfo:{mentionedJid: [me.jid]}})
break
case 'totaluser':
frhan.updatePresence(from, Presence.composing)
if (!isPublic) return reply(mess.only.publikG)
if (!isUser) return reply(mess.only.userB)
if (!isOwner) return reply(mess.only.ownerB)
teks = `╭────「 *TOTAL USER ${name}* 」\n`
no = 0
for (let hehehe of user) {
no += 1
teks += `[${no.toString()}] @${hehehe.split('@')[0]}\n`
}
teks += `│+ Total Pengguna : ${user.length}\n╰──────⎿ *${name}* ⏋────`
frhan.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": user}})
break
case 'blocklist':
teks = 'List Block :\n'
for (let block of blocked) {
teks += `~> @${block.split('@')[0]}\n`
}
teks += `Total : ${blocked.length}`
frhan.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": blocked}})
break
case 'banlist':
ben = '```List Banned``` :\n'
for (let banned of ban) {
ben += `~> @${banned.split('@')[0]}\n`
}
ben += `Total : ${ban.length}`
frhan.sendMessage(from, ben.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": ban}})
break
case 'premiumlist':
frhan.updatePresence(from, Presence.composing)
if (!isPublic) return reply(mess.only.publikG)
if (!isUser) return reply(mess.only.userB)
teks = `╭─「 *TOTAL USER PREMIUM ${name}* 」\n`
no = 0
for (let prem of premium) {
no += 1
teks += `[${no.toString()}] @${prem.split('@')[0]}\n`
}
teks += `│+ Total User Premium : ${premium.length}\n╰──────⎿ *${name}* ⏋────`
frhan.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": premium}})
break
case 'ban':
frhan.updatePresence(from, Presence.composing)
if (args.length < 1) return
if (!isOwner) return reply(mess.only.ownerB)
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
ban = mentioned
reply(`berhasil banned : ${ban}`)
break
case 'addprem':
frhan.updatePresence(from, Presence.composing)
if (args.length < 1) return
if (!isOwner) return reply(mess.only.ownerB)
addpremium = mek.message.extendedTextMessage.contextInfo.mentionedJid
premium = addpremium
reply(`*Berhasil Menambahkan ${premium} Ke database User Premium*`)
break
case 'removeprem':
if (!isOwner) return reply(mess.only.ownerB)
rprem = body.slice(13)
premium.splice(`${rprem}@s.whatsapp.net`, 1)
reply(`Berhasil Remove wa.me/${rprem} Dari User Premium`)
break
case 'unban':
if (!isOwner)return reply(mess.only.ownerB)
bnnd = body.slice(8)
ban.splice(`${bnnd}@s.whatsapp.net`, 1)
reply(`Nomor wa.me/${bnnd} telah di unban!`)
break
case 'block':
frhan.updatePresence(from, Presence.composing)
if (!isGroup) return reply(mess.only.group)
if (!isOwner) return reply(mess.only.ownerB)
frhan.blockUser (`${body.slice(7)}@c.us`, "add")
frhan.sendMessage(from, `perintah Diterima, memblokir ${body.slice(7)}@c.us`, text)
break
case 'unblock':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isOwner) return reply(mess.only.ownerB)
frhan.blockUser (`${body.slice(9)}@c.us`, "remove")
frhan.sendMessage(from, `perintah Diterima, membuka blokir ${body.slice(9)}@c.us`, text)
break
case 'readmore':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (args.length < 1) return reply('teks nya mana om?')
var kls = body.slice(9)
var has = kls.split("/")[0];
var kas = kls.split("/")[1];
if (args.length < 1) return reply(mess.blank)
frhan.sendMessage(from, `${has}${kas}` , text, { quoted: mek })
break
case 'resetlimit':
if (!isOwner) return reply(mess.only.ownerB)
var obj = []
fs.writeFileSync('./database/json/limit.json', JSON.stringify(obj))
await reply(`LIMIT BERHASIL DI RESET`)
break
case 'limit':
var found = false
const limidat = JSON.parse(fs.readFileSync('./database/json/limit.json'))
for (let lmt of limidat) {
if (lmt.id === sender) {
let limitCounts = limitt - lmt.limit
if (limitCounts <= 0) return reply(from,`Limit anda habis`, id)
await reply(`*LIMIT ANDA TINGGAL: ${limitCounts}*`)
found = true
}
}
if (found === false) {
let obj = { id : sender, limit : 1 }
limit.push(obj);
fs.writeFileSync('./database/json/limit.json', JSON.stringify(limit, 1));
await reply(`LIMIT ANDA ${limitCounts}`)
}
break
case 'ocr':
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 frhan.downloadAndSaveMediaMessage(encmedia)
reply(mess.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('Foto aja gan Jangan Video')
}
await limitAdd(sender)
break
case 'gifstiker':
case 'stiker':
case 'sticker':
case 's':
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 frhan.downloadAndSaveMediaMessage(encmedia)
if (isLimit(sender)) return reply(limitend(pushname2))
reply(mess.wait)
const 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)
frhan.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:[email protected], 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 frhan.downloadAndSaveMediaMessage(encmedia)
const ran= getRandom('.webp')
reply(mess.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(`\`\`\`Gagal, pada saat mengkonversi ${tipe} ke stiker\`\`\``)
})
.on('end', function () {
console.log('Finish')
buff = fs.readFileSync(ran)
frhan.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:[email protected], split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])
.toFormat('webp')
.save(ran)
} else if ((isMedia || isQuotedImage) && args[0] == 'nobg') {
const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
const media = await frhan.downloadAndSaveMediaMessage(encmedia)
ranw = getRandom('.webp')
ranp = getRandom('.png')
reply(mess.wait)
keyrmbg = 'bcAvZyjYAjKkp1cmK8ZgQvWH'
await removeBackgroundFromImageFile({path: media, apiKey: keyrmbg.result, size: 'auto', type: 'auto', ranp}).then(res => {
fs.unlinkSync(media)
let buffer = Buffer.from(res.base64img, 'base64')
fs.writeFileSync(ranp, buffer, (err) => {
if (err) return reply('Gagal, Terjadi kesalahan, silahkan coba beberapa saat lagi.')
})
exec(`ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${ranw}`, (err) => {
fs.unlinkSync(ranp)
if (err) return reply(mess.error.stick)
buff = fs.readFileSync(ranw)
frhan.sendMessage(from, buff, sticker, {quoted: mek})
})
})
} else {
reply(`Kirim gambar dengan caption ${prefix}sticker atau tag gambar yang sudah dikirim`)
}
await limitAdd(sender)
break
case 'trigger':
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isBanned) return reply (mess.only.benned)
if (isLimit(sender)) return reply(limits.limitend(pushname2))
var imgbb = require('imgbb-uploader')
if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {
ger = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
reply(mess.wait)
owgi = await frhan.downloadAndSaveMediaMessage(ger)
anu = await imgbb("727e7e43f6cda1dfb85d888522fd4ce1", owgi)
teks = `${anu.display_url}`
ranp = getRandom('.gif')
rano = getRandom('.webp')
anu1 = `https://some-random-api.ml/canvas/triggered?avatar=${teks}`
exec(`wget ${anu1} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {
fs.unlinkSync(ranp)
if (err) return reply(mess.error.stick)
nobg = fs.readFileSync(rano)
frhan.sendMessage(from, nobg, sticker, {quoted: mek})
fs.unlinkSync(rano)
})
} else {
reply('Gunakan foto!')
}
await limitAdd(sender)
break
case 'img2url':
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isBanned) return reply(mess.only.benned)
if (isLimit(sender)) return reply(limitend(pushname2))
reply(mess.wait)
var encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek
var media = await frhan.downloadAndSaveMediaMessage(encmedia)
var imgbb = require('imgbb-uploader')
imgbb('727e7e43f6cda1dfb85d888522fd4ce1', media)
.then(data => {
var caps = `「 *IMAGE TO URL* 」\n\n*╠➥ ID :* ${data.id}\n*╠➥ MimeType :* ${data.image.mime}\n*╠➥ Extension :* ${data.image.extension}\n\n*╠➥ URL :* ${data.display_url}`
ibb = fs.readFileSync(media)
frhan.sendMessage(from, ibb, image, { quoted: mek, caption: caps })
})
.catch(err => {
throw err
})
await limitAdd(sender)
break
case 'kalkulator':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return reply(`[❗] Kirim perintah *${prefix}kalkulator [ Angka ]*\nContoh : ${prefix}kalkulator 12*12\n*NOTE* :\n- Untuk Perkalian Menggunakan *\n- Untuk Pertambahan Menggunakan +\n- Untuk Pengurangan Mennggunakan -\n- Untuk Pembagian Menggunakan /`)
mtk = `${body.slice(12)}`
anu = await fetchJson(`https://api.vhtear.com/calculator?value=${mtk}&apikey=${VthearApi}`, {method: 'get'})
frhan.sendMessage(from, `*${anu.result.data}*`, text, {quoted: mek})
await limitAdd(sender)
break
case 'owner':
frhan.sendMessage(from, {displayname: "jeff", vcard: vcard}, MessageType.contact, { quoted: mek})
frhan.sendMessage(from, 'Jika Mau Save Chat Aja Gan Ntar Disave Back:)',text, { quoted: mek} )
break
case 'fitnah':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (args.length < 1) return reply(`Usage :\n${prefix}fitnah [@tag/pesan/balasanbot]]\n\nEx : \n${prefix}fitnah @tagmember/hai/hai juga`)
var gh = body.slice(8)
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
var replace = gh.split("/")[0];
var target = gh.split("/")[1];
var bot = gh.split("/")[2];
frhan.sendMessage(from, `${bot}`, text, {quoted: { key: { fromMe: false, participant: `${mentioned}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target}` }}})
break
case 'infogc':
case 'groupinfo':
case 'infogrup':
case 'grupinfo':
if (isBanned) return reply(mess.only.benned)
if (!isPublic) return reply(mess.only.publikG)
if (!isUser) return reply(mess.only.userB)
frhan.updatePresence(from, Presence.composing)
if (!isGroup) return reply(mess.only.group)
try {
ppUrl = await frhan.getProfilePicture(from)
} catch {
ppUrl = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'
}
reply(mess.wait) // leave empty to get your own
buffer = await getBuffer(ppUrl)
frhan.sendMessage(from, buffer, image, {quoted: mek, caption: `*NAME* : ${groupName}\n*MEMBER* : ${groupMembers.length}\n*ADMIN* : ${groupAdmins.length}\n*DESK* : ${groupDesc}`})
break
case 'trendtwit':
frhan.updatePresence(from, Presence.composing)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
data = await fetchJson(`https://docs-jojo.herokuapp.com/api/trendingtwitter`, {method: 'get'})
reply(mess.wait)
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( () => {
frhan.sendMessage(from, 'Waktu habis:v', text, {quoted: mek}) // ur cods
}, 10000) // 1000 = 1s,
setTimeout( () => {
frhan.sendMessage(from, '5 Detik lagi', text, {quoted: mek}) // ur cods
}, 5000) // 1000 = 1s,
setTimeout( () => {
frhan.sendMessage(from, '10 Detik lagi', text, {quoted: mek}) // ur cods
}, 0) // 1000 = 1s,
break
case 'animecry':
cry = getRandom('.gif')
rano = getRandom('.webp')
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/cry?apikey=${TobzApi}`, {method: 'get'})
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (isBanned) return reply(mess.only.benned)
if (!isGroup) return reply(mess.only.group)
reply (mess.wait)
exec(`wget ${anu.result} -O ${cry} && ffmpeg -i ${cry} -vcodec libwebp -filter:v fps=fps=15 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {
fs.unlinkSync(cry)
buffer = fs.readFileSync(rano)
frhan.sendMessage(from, buffer, sticker, {quoted: mek})
fs.unlinkSync(rano)
})
await limitAdd(sender)
break
case 'neonime':
frhan.updatePresence(from, Presence.composing)
data = await fetchJson(`https://api.vhtear.com/neonime_search?query=${body.slice(9)}&apikey=${VthearApi}`, {method: 'get'})
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (isBanned) return reply(mess.only.benned)
if (!isGroup) return reply(mess.only.group)
reply(mess.wait)
teks = '#############################\n'
for (let i of data.result) {
teks += `*Title* : ${i.title}\n*link* : ${i.link}\n\n : ${i.desk}\n###########################\n`
}
reply(teks.trim())
await limitAdd(sender)
break
case 'animehug':
ranp = getRandom('.gif')
rano = getRandom('.webp')
anu = await fetchJson(`https://tobz-api.herokuapp.com/api/hug?apikey=${TobzApi}`, {method: 'get'})
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (isBanned) return reply(mess.only.benned)
if (!isGroup) return reply(mess.only.group)
reply(mess.wait)
exec(`wget ${anu.result} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=15 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {
fs.unlinkSync(ranp)
buffer = fs.readFileSync(rano)
frhan.sendMessage(from, buffer, sticker, {quoted: mek})
fs.unlinkSync(rano)
})
await limitAdd(sender)
break
case 'linkgroup':
case 'linkgrup':
case 'linkgc':
case 'gruplink':
case 'grouplink':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
linkgc = await frhan.groupInviteCode (from)
yeh = `https://chat.whatsapp.com/${linkgc}\n\nlink Group *${groupName}*`
frhan.sendMessage(from, yeh, text, {quoted: mek})
break
case 'hidetag':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
var value = body.slice(9)
var group = await frhan.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
}
frhan.sendMessage(from, options, text)
break
case 'gantengcek':
case 'cekganteng':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
ganteng = body.slice(12)
const gan =['10%','30%','20%','40%','50%','60%','70%','62%','74%','83%','97%','100%','29%','94%','75%','82%','41%','39%']
const teng = gan[Math.floor(Math.random() * gan.length)]
frhan.sendMessage(from, 'Pertanyaan : Cek Ganteng Bang *'+ganteng+'*\n\nJawaban : '+ teng +'', text, { quoted: mek })
break
case 'cantikcek':
case 'cekcantik':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
cantik = body.slice(11)
if (args.length < 1) return reply('Yg Mau dicek Siapa Kak??')
const can =['10% banyak" perawatan ya kak:v\nCanda Perawatan:v','30% Semangat Kaka Merawat Dirinya><','20% Semangat Ya Kaka👍','40% Wahh Kaka><','50% kaka cantik deh><','60% Hai Cantik🐊','70% Hai Ukhty🐊','62% Kakak Cantik><','74% Kakak ni cantik deh><','83% Love You Kakak><','97% Assalamualaikum Ukhty🐊','100% Kakak Pake Susuk ya??:v','29% Semangat Kakak:)','94% Hai Cantik><','75% Hai Kakak Cantik','82% wihh Kakak Pasti Sering Perawatan kan??','41% Semangat:)','39% Lebih Semangat🐊']
const tik = can[Math.floor(Math.random() * can.length)]
frhan.sendMessage(from, 'Pertanyaan : Cantik Cek Kakak *'+cantik+'*\n\nPersen Kecantikan : '+ tik +'', text, { quoted: mek })
break
case 'ownergrup':
case 'ownergroup':
frhan.updatePresence(from, Presence.composing)
options = {
text: `Owner Group ini adalah : wa.me/${from.split("-")[0]}`,
contextInfo: { mentionedJid: [from] }
}
frhan.sendMessage(from, options, text, { quoted: mek } )
break
case 'leave':
if (!isGroup) return reply(mess.only.group)
if (!isOwner) return reply(mess.only.ownerB)
anu = await frhan.groupLeave(from, `Bye All Member *${groupMetadata.subject}*`, groupId)
break
case 'setname':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isGroupAdmins) return reply(mess.only.admin)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
frhan.groupUpdateSubject(from, `${body.slice(9)}`)
frhan.sendMessage(from, `\`\`\`✓Sukses Mengganti Nama Group Menjadi\`\`\` *${body.slice(9)}*`, text, {quoted: mek})
break
case 'setdesc':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isGroupAdmins) return reply(mess.only.admin)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
frhan.groupUpdateDescription(from, `${body.slice(9)}`)
frhan.sendMessage(from, `\`\`\`✓Sukses Mengganti Deskripsi Group\`\`\` *${groupMetadata.subject}* Menjadi: *${body.slice(9)}*`, text, {quoted: mek})
break
case 'tts':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return frhan.sendMessage(from, 'Kode bahasanya mana gan?\n Kalo Gatau Kode Bahasanya Apa Aja Ketik Saja *${prefix}bahasa*', text, {quoted: mek})
const gtts = require('./lib/gtts')(args[0])
if (args.length < 2) return frhan.sendMessage(from, 'Textnya mana gan?', text, {quoted: mek})
dtt = body.slice(9)
ranm = getRandom('.mp3')
rano = getRandom('.ogg')
dtt.length > 600
? reply('Textnya kebanyakan gan')
: 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('Gagal gan:(')
reply(mess.wait)
frhan.sendMessage(from, buff, audio, {quoted: mek, ptt:true})
fs.unlinkSync(rano)
})
})
await limitAdd(sender)
break
case 'translate':
case 'translete':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return frhan.sendMessage(from, 'Kode Bahasanya???', text, {quoted: mek})
if (args.length < 2) return frhan.sendMessage(from, 'Text Yg Mau Di translate??', text, {quoted: mek})
ts = body.slice(11)
kode = ts.split("/")[0]
teks = ts.split("/")[1]
anu = await fetchJson(`https://api.arugaz.my.id/api/edu/translate?lang=${kode}&text=${teks}`)
reply(mess.wait)
translate = `Text Asli: *${body.slice(11)}*\n\nHasil: *${anu.text}*`
frhan.sendMessage(from, translate, text, {quoted: mek})
await limitAdd(sender)
break
case 'ts':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (isLimit(sender)) return reply(limitend(pushname2))
if (args.length < 1) return frhan.sendMessage(from, 'Kode Bahasanya???', text, {quoted: mek})
if (args.length < 2) return frhan.sendMessage(from, 'Text Yg Mau Di translate??', text, {quoted: mek})
ts = body.slice(4)
kode = ts.split("/")[0]
teks = ts.split("/")[1]
anu = await fetchJson(`https://api.arugaz.my.id/api/edu/translate?lang=${kode}&text=${teks}`)
reply(mess.wait)
ts = `Text Asli: *${body.slice(7)}*\n\nHasil: *${anu.text}*`
frhan.sendMessage(from, ts, text, {quoted: mek})
await limitAdd(sender)
break
case 'setpp':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
if (!isGroup) return reply(mess.only.group)
if (!isGroupAdmins) return reply(mess.only.admin)
if (!isBotGroupAdmins) return reply(mess.only.Badmin)
media = await frhan.downloadAndSaveMediaMessage(mek)
await frhan.updateProfilePicture (from, media)
reply(mess.wait)
reply(`\`\`\`✓Sukses Mengganti Profil Group\`\`\` *${groupMetadata.subject}*`)
break
case 'apakah':
if (isBanned) return reply(mess.only.benned)
if (!isUser) return reply(mess.only.userB)
if (!isPublic) return reply(mess.only.publikG)
apakah = body.slice(1)