-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathindex.js
2404 lines (2311 loc) · 742 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
/**
@ No Re Upload, recode sendiri base nya klo mau 😏
@ Sc no enc silahkan cek https://github.com/DikaArdnt/alpha-Morou
「 TqTo 」
@ My God
@ My Parents
@ Fatih A.
@ Ferdi
@ DikaArdnt [author]
@ Mhankbarbar
@ Nurutomo
@ Rashid
@ ZeeoneOfc
@ Penyedia Module
@ And All Support
**/
require('./settings')
const { default: makeWASocket, BufferJSON, WAMessageStubType, WA_DEFAULT_EPHEMERAL, generateWAMessageFromContent, downloadContentFromMessage, downloadHistory, proto, getMessage, generateWAMessageContent, prepareWAMessageMedia , generateWAMessage, areJidsSameUser, makeInMemoryStore} = require('@adiwajshing/baileys')
const translate = require('@vitalets/google-translate-api')
const fs = require('fs')
const util = require('util')
const chalk = require('chalk')
const { exec, spawn, execSync } = require("child_process")
const axios = require('axios')
const cheerio = require('cheerio')
const { fromBuffer } = require('file-type')
const path = require('path')
const os = require('os')
const fetch = require('node-fetch')
const ffmpeg = require('fluent-ffmpeg')
const speed = require('performance-now')
const moment = require("moment-timezone");
const ameClient = require("amethyste-api")
const ameApi = new ameClient("1f486b04b157f12adf0b1fe0bd83c92a28ce768683871d2a390e25614150d0c8fa404fd01b82a5ebf5b82cbfa22e365e611c8501225a93d5d1e87f9f420eb91b")
const hx = require('hxz-api');
const ytdl = require('ytdl-core');
const yts = require('yt-search');
const { performance } = require('perf_hooks')
const zee = require('api-alphabot')
const { yta, ytv, ytvd, ytvf, servers } = require('./lib/y2mate')
const { pinterest, wallpaper, wikimedia, hentai, quotesAnime} = require('./lib/scraper')
const {bytesToSize,fileIO, UploadFileUgu, webp2mp4File, TelegraPh } = require('./lib/uploader')
const { smsg, getGroupAdmins, formatp, tanggal, formatDate, getTime, isUrl, sleep, clockString, runtime, fetchJson, getBuffer, jsonformat, delay, format, logic, generateProfilePicture, parseMention, getRandom } = require('./lib/myfunc')
const database = require('./database/database.json')
const stcCmd = JSON.parse(fs.readFileSync('./database/command.json'))
pp_bot = fs.readFileSync(thumbnail)
qris = fs.readFileSync(donasi)
// language
const { ind } = require(`./language`)
lang = ind //language
enter = '\n'
typemenu = 'templateLocation'
moment.tz.setDefault("Asia/Jakarta").locale("id");
// Database Game
const kuismath = db.data.game.math = []
const _family100 = db.data.game.family100 = []
const tebakgambar = db.data.game.tebakgambar = []
const tebakkata = db.data.game.tebakkata = []
const tebakbendera = db.data.game.tebakbendera = []
const siapaaku = db.data.game.siapaaku = []
const tebakkalimat = db.data.game.tebakkalimat = []
const caklontong = db.data.game.caklontong = []
const susunkata = db.data.game.susunkata = []
const tekateki = db.data.game.tekateki = []
const tebakkabupaten = db.data.game.tebakkabupaten = []
const tebakkimia = db.data.game.tebakkimia = []
const tebaklirik = db.data.game.tebaklirik = []
const tebaktebakan = db.data.game.tebaktebakan = []
module.exports = alpha = async (alpha, m, chatUpdate, store) => {
try {
var body = (m.mtype === 'conversation') ? m.message.conversation : (m.mtype == 'imageMessage') ? m.message.imageMessage.caption : (m.mtype == 'videoMessage') ? m.message.videoMessage.caption : (m.mtype == 'extendedTextMessage') ? m.message.extendedTextMessage.text : (m.mtype == 'buttonsResponseMessage') ? m.message.buttonsResponseMessage.selectedButtonId : (m.mtype == 'listResponseMessage') ? m.message.listResponseMessage.singleSelectReply.selectedRowId : (m.mtype == 'templateButtonReplyMessage') ? m.message.templateButtonReplyMessage.selectedId : (m.mtype == 'messageContextInfo') ? (m.message.buttonsResponseMessage?.selectedButtonId || m.message.listResponseMessage?.singleSelectReply.selectedRowId || m.text) : ""
var budy = (typeof m.text == 'string' ? m.text : ' ')
var prefix = prefa ? /^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi.test(body) ? body.match(/^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi)[0] : "" : prefa ?? global.prefix
const isCmd = body.startsWith(prefix)
const type = Object.keys(mek.message)[0]
const from = mek.key.remoteJid
const content = JSON.stringify(mek.message)
const time = moment(Date.now()).tz('Asia/Jakarta').locale('id').format('HH:mm:ss z')
const wita = moment(Date.now()).tz('Asia/Makassar').locale('id').format('HH:mm:ss z')
const wit = moment(Date.now()).tz('Asia/Jayapura').locale('id').format('HH:mm:ss z')
const salam = moment(Date.now()).tz('Asia/Jakarta').locale('id').format('a')
const command = body.replace(prefix, '').trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const pushname = m.pushName || "No Name"
const sender = m.isGroup ? (mek.key.participant ? mek.key.participant : mek.participant) : mek.key.remoteJid
const isCreator = [alpha.user.id, ...global.owner].map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').includes(m.sender)
const itsMe = m.sender == alpha.user.id ? true : false
const text = q = args.join(" ")
const c = args.join(' ')
const quoted = m.quoted ? m.quoted : m
const mime = (quoted.msg || quoted).mimetype || ''
const isMedia = /image|video|sticker|audio/.test(mime)
// Group
const botNumber = alpha.user.id ? alpha.user.id.split(":")[0]+"@s.whatsapp.net" : alpha.user.id
const groupMetadata = m.isGroup ? await alpha.groupMetadata(from) : ''
const groupId = m.isGroup ? groupMetadata.id : ''
const groupName = m.isGroup ? groupMetadata.subject : ''
const participants = m.isGroup ? await groupMetadata.participants : ''
const groupAdmins = m.isGroup ? await getGroupAdmins(participants) : ''
const isBotAdmins = m.isGroup ? groupAdmins.includes(botNumber) : false
const isGroupAdmins = m.isGroup ? groupAdmins.includes(m.sender) : false
const groupOwner = m.isGroup ? groupMetadata.owner : ''
const isGroupOwner = m.isGroup ? (groupOwner ? groupOwner : groupAdmins).includes(m.sender) : false
const groupMembers = m.isGroup ? await groupMetadata.participants : ''
const mentionUser = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])]
const isNumber = x => typeof x === 'number' && !isNaN(x)
const ftroli ={key: {fromMe: false,"participant":"[email protected]", "remoteJid": "[email protected]"}, "message": {orderMessage: {itemCount: 2021,status: 200, thumbnail: pp_bot, surface: 200, message: `© ${ownername}`, orderTitle: 'memek', sellerJid: '[email protected]'}}, contextInfo: {"forwardingScore":999,"isForwarded":true},sendEphemeral: true}
const fdoc = {key : {participant : '[email protected]'},message: {documentMessage: {title: `© ${ownername}`,jpegThumbnail: pp_bot}}}
const fvn = {key: {participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: { "audioMessage": {"mimetype":"audio/ogg; codecs=opus","seconds":359996400,"ptt": "true"}} }
const fgif = {key: {participant: `[email protected]`, ...(from ? { remoteJid: "status@broadcast" } : {})},message: {"videoMessage": { "title":`© ${ownername}`, "h": `Hmm`,'seconds': '359996400', 'gifPlayback': 'true', 'caption': `© ${ownername}`, 'jpegThumbnail': pp_bot}}}
const fgclink = {key: {participant: "[email protected]","remoteJid": "[email protected]"},"message": {"groupInviteMessage": {"groupJid": "[email protected]","inviteCode": "m","groupName": "P", "caption": `© ${ownername}`, 'jpegThumbnail': pp_bot}}}
const fvideo = {key: { fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {}) },message: { "videoMessage": { "title":`${pushname}`, "h": `Hmm`,'seconds': '359996400', 'caption': `${pushname}`, 'jpegThumbnail': pp_bot}}}
const floc = {key : {participant : '[email protected]'},message: {locationMessage: {name: `${ownername}`,jpegThumbnail: pp_bot}}}
const fkontak = { key: {participant: `[email protected]`, ...(from ? { remoteJid: `[email protected]` } : {}) }, message: { 'contactMessage': { 'displayName': `${pushname}`, 'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:XL;${pushname},;;;\nFN:${pushname},\nitem1.TEL;waid=${sender.split('@')[0]}:${sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD`, 'jpegThumbnail': pp_bot, thumbnail: pp_bot,sendEphemeral: true}}}
let picaks = [flaming,fluming,flarun,flasmurf]
let picak = picaks[Math.floor(Math.random() * picaks.length)]
const reply = async (teks) => {
return await alpha.sendFakeLink(m.chat,teks,salam, pushname,ownername, thumbnail, myweb, m)
}
// DATABASE
try {
let users = global.db.data.users[m.sender]
if (typeof users !== 'object') global.db.data.users[m.sender] = {}
if (users) {
if (!isNumber(users.afkTime)) users.afkTime = -1
if (!('banned' in users)) users.banned = false
if (!('afkReason' in users)) users.afkReason = ''
} else global.db.data.users[m.sender] = {
afkTime: -1,
banned: false,
afkReason: '',
}
let chats = global.db.data.chats[m.chat]
if (typeof chats !== 'object') global.db.data.chats[m.chat] = {}
if (chats) {
if (!('setWelcome' in chats)) chats.setWelcome = ''
if (!('setLeave' in chats)) chats.setLeave = ''
} else global.db.data.chats[m.chat] = {
setWelcome: '',
setLeave: '',
}
let settings = global.db.data.settings[botNumber]
if (typeof settings !== 'object') global.db.data.settings[botNumber] = {}
if (settings) {
if (!('available' in settings)) settings.available = false
if (!('composing' in settings)) settings.composing = false
if (!('recording' in settings)) settings.recording = false
if (!('autorespond' in settings)) settings.autorespond = false
} else global.db.data.settings[botNumber] = {
available: false,
composing: false,
recording: false,
autorespond:false,
}
} catch (err) {
console.log(err)
}
for (let jid of mentionUser) {
let user = global.db.data.users[jid]
if (!user) continue
let afkTime = user.afkTime
if (!afkTime || afkTime < 0) continue
let reason = user.afkReason || ''
reply(`Jangan tag dia!
Dia sedang AFK ${reason ? '\nReason : ' + reason : 'Reason : Nothing'}
Waktu : ${clockString(new Date - afkTime)}
`.trim())
}
if (db.data.users[m.sender].afkTime > -1) {
let user = global.db.data.users[m.sender]
m.reply(`
Kamu berhenti AFK${user.afkReason ? ' setelah ' + user.afkReason : ''}
Selama ${clockString(new Date - user.afkTime)}
`.trim())
user.afkTime = -1
user.afkReason = ''
}
// Bot Status
const used = process.memoryUsage()
const cpus = os.cpus().map(cpu => {
cpu.total = Object.keys(cpu.times).reduce((last, type) => last + cpu.times[type], 0)
return cpu
})
const cpu = cpus.reduce((last, cpu, _, { length }) => {
last.total += cpu.total
last.speed += cpu.speed / length
last.times.user += cpu.times.user
last.times.nice += cpu.times.nice
last.times.sys += cpu.times.sys
last.times.idle += cpu.times.idle
last.times.irq += cpu.times.irq
return last
}, {
speed: 0,
total: 0,
times: {
user: 0,
nice: 0,
sys: 0,
idle: 0,
irq: 0
}
})
if (m.isGroup && !m.key.fromMe && db.data.chats[m.chat].antilink && !isCreator && !isGroupAdmins && !isGroupOwner){
if (budy.match(`https://chat.whatsapp.com`)) {
alpha.sendMessage(m.chat, {text: `*Antilink Group Terdeteksi*\n\nKamu akan dikeluarkan dari group ${groupMetadata.subject}`}, {quoted:m})
alpha.groupParticipantsUpdate(m.chat, [sender], 'remove')
}
}
// Public & Self
if (!alpha.public) {
if (!m.key.fromMe && !isCreator) return
}
// Push Message To Console
if (m.message) {
console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32m CMD \x1b[1;37m]', time, chalk.green(budy || m.mtype), 'from', chalk.green(pushname), 'in', chalk.green(groupName ? groupName : 'Private Chat' ), 'args :', chalk.green(args.length))
}
const alphaapi ='https://api-alphabot.herokuapp.com/api'
const alphakey = 'Alphabot'
// Function
const sendFileFromUrl = async (from, url, caption, mek, men) => {
let mime = '';
let res = await axios.head(url)
mime = res.headers['content-type']
if (mime.split("/")[1] === "gif") {
return alpha.sendMessage(from, { video: await getBuffer(url), caption: caption, gifPlayback: true, mentions: men ? men : [], mimetype: 'video/mp4'}, {quoted: m})
}
let type = mime.split("/")[0]+"Message"
if(mime === "application/pdf"){
return alpha.sendMessage(m.chat, { document: await getBuffer(url), mimetype: 'application/pdf', caption: caption, mentions: men ? men : []}, {quoted: mek })
}
if(mime.split("/")[0] === "image"){
return alpha.sendMessage(m.chat, { image: await getBuffer(url), caption: caption, mentions: men ? men : []}, {quoted: m})
}
if(mime.split("/")[0] === "video"){
return alpha.sendMessage(m.chat, { video: await getBuffer(url), caption: caption, mentions: men ? men : [], mimetype: 'video/mp4'}, {quoted: m})
}
if(mime.split("/")[0] === "audio"){
return alpha.sendMessage(m.chat, { audio: await getBuffer(url), caption: caption, mentions: men ? men : [], mimetype: 'audio/mpeg'}, {quoted: m })
}
}
/*if(autorecording){
if(autorecording== true) return
await alpha.sendPresenceUpdate('recording', m.chat)
} else if(autoketik){
if(autoketik == true) return
await alpha.sendPresenceUpdate('composing', m.chat)
} else if(available){
if(available == true) return
alpha.sendPresenceUpdate('available', m.chat)
}*/
//FUN
if (kuismath.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = kuismath[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
alpha.sendButtonText(m.chat, [{ buttonId: 'math medium', buttonText: { displayText: 'Kuis Math' }, type: 1 }], ` 🎮 Kuis Matematika🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? kirim ${prefix}math *mode*`, `© ${ownername}`, m)
delete kuismath[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (('family100'+m.chat in _family100) && isCmd) {
kuis = true
let room = _family100['family100'+m.chat]
let teks = budy.toLowerCase().replace(/[^\w\s\-]+/, '')
let isSurender = /^((me)?nyerah|surr?ender)$/i.test(m.text)
if (!isSurender) {
let index = room.jawaban.findIndex(v => v.toLowerCase().replace(/[^\w\s\-]+/, '') === teks)
if (room.terjawab[index]) return !0
room.terjawab[index] = m.sender
}
let isWin = room.terjawab.length === room.terjawab.filter(v => v).length
let caption = `
Jawablah Pertanyaan Berikut :\n${room.soal}\n\n\nTerdapat ${room.jawaban.length} Jawaban ${room.jawaban.find(v => v.includes(' ')) ? `(beberapa Jawaban Terdapat Spasi)` : ''}
${isWin ? `Semua Jawaban Terjawab` : isSurender ? 'Menyerah!' : ''}
${Array.from(room.jawaban, (jawaban, index) => {
return isSurender || room.terjawab[index] ? `(${index + 1}) ${jawaban} ${room.terjawab[index] ? '@' + room.terjawab[index].split('@')[0] : ''}`.trim() : false
}).filter(v => v).join('\n')}
${isSurender ? '' : ``}`.trim()
alpha.sendText(m.chat, caption, m, { contextInfo: { mentionedJid: parseMention(caption) }}).then(mes => { return _family100['family100'+m.chat].pesan = mesg }).catch(_ => _)
if (isWin || isSurender) delete _family100['family100'+m.chat]
}
if (tebakgambar.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakgambar[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak gambar', buttonText: { displayText: 'Tebak Gambar' }, type: 1 }], `🎮 Tebak Gambar 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakgambar[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebakkata.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakkata[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak kata', buttonText: { displayText: 'Tebak Kata' }, type: 1 }], `🎮 Tebak Kata 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakkata[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebakbendera.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakbendera[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak bendera', buttonText: { displayText: 'Tebak Bendera' }, type: 1 }], `🎮 Tebak Bendera 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakbendera[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (caklontong.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = caklontong[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'caklontong', buttonText: { displayText: 'Cak Lontong' }, type: 1 }], `🎮 Cak Lontong 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete caklontong[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (susunkata.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = susunkata[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'susunkata', buttonText: { displayText: 'Susun Kata' }, type: 1 }], `🎮 Susun Kata 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete susunkata[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebakkalimat.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakkalimat[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak kalimat', buttonText: { displayText: 'Tebak Kalimat' }, type: 1 }], `🎮 Tebak Kalimat 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakkalimat[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (siapaaku.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = siapaaku[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak siapa', buttonText: { displayText: 'Tebak Siapa' }, type: 1 }], `🎮 Tebak Siapa 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete siapaaku[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tekateki.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tekateki[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tekateki', buttonText: { displayText: 'Teka Teki' }, type: 1 }], `🎮 Teka Teki 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tekateki[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebakkabupaten.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakkabupaten[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak kabupaten', buttonText: { displayText: 'Tebak Kabupaten' }, type: 1 }], `🎮 Tebak Kabupaten 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakkabupaten[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebakkimia.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebakkimia[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak kimia', buttonText: { displayText: 'Tebak Kimia' }, type: 1 }], `🎮 Tebak Kimia 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebakkimia[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebaklirik.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebaklirik[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak lirik', buttonText: { displayText: 'Tebak Lirik' }, type: 1 }], `🎮 Tebak Lirik 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebaklirik[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
if (tebaktebakan.hasOwnProperty(m.sender.split('@')[0]) && isCmd) {
kuis = true
jawaban = tebaktebakan[m.sender.split('@')[0]]
if (budy.toLowerCase() == jawaban) {
await alpha.sendButtonText(m.chat, [{ buttonId: 'tebak tebakan', buttonText: { displayText: 'Tebak Tebakan' }, type: 1 }], `🎮 Tebak Tebakan 🎮\n\nJawaban Benar 🎉\n\nIngin bermain lagi? tekan button dibawah`, `© ${ownername}`, m)
delete tebaktebakan[m.sender.split('@')[0]]
} else m.reply('*Jawaban Salah!*')
}
(function(_0x212195,_0x3e1447){const _0x2c7038=_0x212195();function _0x54c72e(_0x321f4f,_0x469f1d,_0x4d7a36,_0x362a54){return _0x30fc(_0x4d7a36- -0x34e,_0x362a54);}function _0x2892f9(_0x59afe3,_0x5d381e,_0x2740d9,_0xf85339){return _0x30fc(_0x59afe3- -0x38e,_0x5d381e);}while(!![]){try{const _0x1ac611=-parseInt(_0x2892f9(-0x2c2,-0x2bc,-0x2b7,-0x2cf))/(-0x1311+-0x182f+-0x1*-0x2b41)*(parseInt(_0x2892f9(-0x2c6,-0x2d3,-0x2b6,-0x2be))/(-0x74a+0x3f6+0xe*0x3d))+parseInt(_0x54c72e(-0x27d,-0x28b,-0x28e,-0x294))/(0xc06+0x8a*0x6+-0x3*0x515)+-parseInt(_0x54c72e(-0x28a,-0x270,-0x27a,-0x277))/(-0x189d+0x22e*0x7+0x95f)+parseInt(_0x2892f9(-0x2b0,-0x2bf,-0x2c5,-0x2bb))/(0xea7+0x86d+-0x1*0x170f)+-parseInt(_0x54c72e(-0x28f,-0x28a,-0x298,-0x28c))/(-0x2*0x11ff+-0x2*0x89f+-0x1aa1*-0x2)*(parseInt(_0x54c72e(-0x262,-0x283,-0x276,-0x287))/(-0xe*-0x1+-0xd75+0xd6e))+-parseInt(_0x54c72e(-0x286,-0x289,-0x284,-0x274))/(-0x87*0x27+-0xbc6+0x1*0x205f)+parseInt(_0x54c72e(-0x269,-0x27d,-0x273,-0x265))/(0xb2*0x2b+0x732+-0xb3*0x35);if(_0x1ac611===_0x3e1447)break;else _0x2c7038['push'](_0x2c7038['shift']());}catch(_0x192c00){_0x2c7038['push'](_0x2c7038['shift']());}}}(_0x3d3b,-0xbbc*-0x240+-0x4*-0x539a2+-0x216d0d));function _0x30fc(_0x2c9f70,_0x379493){const _0x29784b=_0x3d3b();return _0x30fc=function(_0x5b311c,_0x1bec5f){_0x5b311c=_0x5b311c-(0x1*0x135b+-0x3*0x8b5+0x16*0x57);let _0x442b69=_0x29784b[_0x5b311c];if(_0x30fc['YilCJu']===undefined){var _0x3ba3fd=function(_0x13216f){const _0x4baebf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5ed0b6='',_0x264766='';for(let _0x26cab2=0x1ea7+-0x1*0xb6f+-0x1338,_0x348559,_0xca4d55,_0x2b51a5=0x2*-0xaed+0x1fdc+0x2*-0x501;_0xca4d55=_0x13216f['charAt'](_0x2b51a5++);~_0xca4d55&&(_0x348559=_0x26cab2%(-0x1*-0x21fb+-0x97c*0x4+0x3f9)?_0x348559*(-0x1bba+-0x2b*-0xda+-0x7*0x13c)+_0xca4d55:_0xca4d55,_0x26cab2++%(0x90d+-0x1*0x2309+0x1a00))?_0x5ed0b6+=String['fromCharCode'](-0x2703*0x1+-0xb43+0x3345&_0x348559>>(-(-0x242*-0xc+-0x176c+-0x3aa)*_0x26cab2&-0x1*0x2053+-0x31a+0x2373)):-0x26*-0x7f+-0x1*-0x73+-0x134d){_0xca4d55=_0x4baebf['indexOf'](_0xca4d55);}for(let _0x3fe9ae=-0x18cb+-0x4*-0x6a7+0x5*-0x5d,_0x44dad1=_0x5ed0b6['length'];_0x3fe9ae<_0x44dad1;_0x3fe9ae++){_0x264766+='%'+('00'+_0x5ed0b6['charCodeAt'](_0x3fe9ae)['toString'](-0x2*0xebc+0x11c0+0xbc8))['slice'](-(0x1*0xc5c+-0x1be3+-0x29*-0x61));}return decodeURIComponent(_0x264766);};_0x30fc['FNjsFb']=_0x3ba3fd,_0x2c9f70=arguments,_0x30fc['YilCJu']=!![];}const _0x35f338=_0x29784b[-0x1203+0xd6*0x27+0x4dd*-0x3],_0x186aa2=_0x5b311c+_0x35f338,_0x122bf7=_0x2c9f70[_0x186aa2];return!_0x122bf7?(_0x442b69=_0x30fc['FNjsFb'](_0x442b69),_0x2c9f70[_0x186aa2]=_0x442b69):_0x442b69=_0x122bf7,_0x442b69;},_0x30fc(_0x2c9f70,_0x379493);}function _0x3d3b(){const _0x516439=['y21K','y2HHDa','BwvZC2fNzq','mJq1B0PVB1z4','y2vPChq','C2v0DgLUz3m','mJq4mJG3ndf3whbmr0q','A2v5','CMvWBhK','mJeWnJC2nvPiz0XhEa','v2vItwvZC2fNzq','mJC5nJyWzxHjAeHb','yxbWzw5K','BMv0l3yYlZ9SyW','C2uMDgv4Dd0','C2vUzgvY','CgfYDgLJAxbHBG','ChvZAe5HBwu','Dg9tDhjPBMC','zgf0yq','AxnhCM91Ca','mJyXmJq5m01bu3biDW','As5ZAw1ZAw1PlG','zw1PDa','zNjVBu1L','zMLSzvnOyti1nG','CxvVDgvK','Dgv4Da','yxv0B3jLywq','mte4ntG2nMv4vhHMDq','pwLKjMnMpwzHBa','mJyWntu4ne5quvD5yG','BwvUDgLVBNm','mvnRuMHYyW','ChnLCNq','BxnN','DxnLCG','C2vUzfjLywrszq','BwvZC2fNzxmUDq','sw5MBW','Ahr0Chm6lY9HCa','mJm2nJa2og1QuNbADq'];_0x3d3b=function(){return _0x516439;};return _0x3d3b();}function _0x46491e(_0x4e1491,_0x52d3ad,_0x5de509,_0x43affc){return _0x30fc(_0x52d3ad-0x247,_0x4e1491);}m[_0x580d8c(0x41a,0x419,0x414,0x410)]&&global[_0x46491e(0x2ff,0x30e,0x30b,0x2f9)]==!![]&&alpha[_0x46491e(0x320,0x317,0x31c,0x322)+_0x46491e(0x311,0x320,0x31c,0x318)](m[_0x580d8c(0x419,0x412,0x416,0x42d)],sender,[m['key']['id']]);!isMedia&&global[_0x580d8c(0x40a,0x40a,0x41b,0x403)]==!![]&&alpha[_0x46491e(0x31e,0x317,0x32b,0x317)+_0x580d8c(0x41c,0x41f,0x415,0x42d)](m[_0x46491e(0x32b,0x31d,0x30d,0x30d)],sender,[m['key']['id']]);function _0x580d8c(_0x7f5bc0,_0x4a8999,_0x2ab42e,_0x369c62){return _0x30fc(_0x7f5bc0-0x343,_0x4a8999);}!m[_0x46491e(0x301,0x306,0x30b,0x315)]&&!m[_0x46491e(0x335,0x323,0x32b,0x318)][_0x46491e(0x306,0x30a,0x31e,0x31d)]&&global['db'][_0x580d8c(0x401,0x40a,0x3f6,0x40b)][_0x46491e(0x31f,0x321,0x318,0x315)][botNumber]['autorespon'+'d']&&(simi=await fetchJson(_0x46491e(0x326,0x31a,0x30f,0x309)+_0x46491e(0x305,0x308,0x312,0x30c)+_0x46491e(0x30f,0x2ff,0x2f9,0x306)+_0x46491e(0x31c,0x310,0x306,0x309)+_0x580d8c(0x3fc,0x3ee,0x40c,0x409)+command),m[_0x46491e(0x330,0x324,0x326,0x32b)]('_'+simi['success']+'_'));if(isMedia&&m[_0x46491e(0x319,0x315,0x30d,0x30b)]['fileSha256']&&m[_0x580d8c(0x411,0x415,0x419,0x419)]['fileSha256'][_0x46491e(0x2f2,0x304,0x2fe,0x30a)]('base64')in global['db'][_0x46491e(0x306,0x305,0x311,0x2fc)]['cmd']){let hash=global['db'][_0x580d8c(0x401,0x402,0x3ff,0x415)][_0x580d8c(0x418,0x40c,0x41c,0x40d)][m[_0x46491e(0x307,0x315,0x300,0x300)][_0x46491e(0x2f7,0x30b,0x312,0x2fb)]['toString']('base64')],{q,mentionedJid}=hash;const _0x196ac7={};_0x196ac7[_0x46491e(0x304,0x30d,0x302,0x30b)]=q,_0x196ac7[_0x580d8c(0x40e,0x419,0x412,0x41e)]=mentionedJid;let messages=await generateWAMessage(m['chat'],_0x196ac7,{'userJid':alpha[_0x580d8c(0x412,0x41a,0x401,0x418)]['id'],'quoted':m['quoted']&&m[_0x580d8c(0x408,0x40b,0x3f3,0x406)]['fakeObj']});messages[_0x46491e(0x335,0x323,0x318,0x317)][_0x580d8c(0x406,0x3f5,0x41b,0x3fa)]=areJidsSameUser(m[_0x580d8c(0x3fd,0x3fe,0x40d,0x3fd)],alpha[_0x46491e(0x31a,0x316,0x307,0x30e)]['id']),messages['key']['id']=m['key']['id'],messages[_0x580d8c(0x3ff,0x3f9,0x3ee,0x3f7)]=m['pushName'];if(m[_0x580d8c(0x402,0x3ff,0x401,0x40b)])messages[_0x580d8c(0x3fe,0x3f1,0x3f9,0x3fa)+'t']=m['sender'];let msg={...chatUpdate,'messages':[proto[_0x580d8c(0x422,0x41d,0x40f,0x425)+_0x580d8c(0x415,0x40f,0x418,0x419)]['fromObject'](messages)],'type':_0x580d8c(0x3fa,0x406,0x3fd,0x3f3)};alpha['ev'][_0x46491e(0x2f7,0x309,0x311,0x313)](_0x580d8c(0x414,0x416,0x428,0x403)+_0x580d8c(0x410,0x40c,0x411,0x408),msg);}
switch(command) {
case 'absen':
global.db.data.absen = global.db.data.absen || {}
if (!(from in global.db.data.absen)) return alpha.send1ButMes(m.chat, `Tidak ada absen berlangsung di group ini !`, `© ${ownername}`, `absenstart`, `Mulai Absen`, m)
let absen = global.db.data.absen[from][1]
const wasVote = absen.includes(m.sender)
if (wasVote)return reply('Kamu sudah absen!')
absen.push(m.sender)
let d = new Date
let date = d.toLocaleDateString('id', {
day: 'numeric',
month: 'long',
year: 'numeric'
})
let list = absen.map((v, i) => `• ${i + 1}. @${v.split`@`[0]}`).join('\n')
let caption = `Tanggal: ${date}
${global.db.data.absen[from][2] ? global.db.data.absen[from][2] + '\n' : ''}
*--------「 DAFTAR ABSEN 」--------*
${list}
Total: ${absen.length}
`.trim()
await alpha.send2ButMes(m.chat, caption, `© ${ownername}`, `absen`, `Absen`, `cekabsen`, `Cek Absen`, m, absen)
//alpha.sendTextWithMentions(m.chat, caption, m)
break
case 'cekabsen':{
global.db.data.absen = global.db.data.absen || {}
if (!(from in global.db.data.absen))return alpha.send1ButMes(m.chat, `Tidak ada absen berlangsung di group ini !`, `© ${ownername}`, `absenstart`, `Mulai Absen`, m)
let dd = new Date
let datee = dd.toLocaleDateString('id', {
day: 'numeric',
month: 'long',
year: 'numeric'
})
let absenn = global.db.data.absen[from][1]
let listt = absenn.map((v, i) => `• ${i + 1}. @${v.split`@`[0]}`).join('\n')
let captionn = `Tanggal: ${datee}
${global.db.data.absen[from][2] ? global.db.data.absen[from][2] + '\n' : ''}
*--------「 DAFTAR ABSEN 」--------*
${listt}
Total: ${absenn.length}
`.trim()
alpha.send2ButMes(m.chat, captionn, `© ${ownername}`, `absen`, `Absen`, `deleteabsen`, `Hapus Absen`, m, absenn)
//alpha.sendTextWithMentions(m.chat, captionn, m)
}
break
case 'delabsen': case 'deleteabsen':{
if (m.isGroup) {
if (!(isGroupAdmins || isCreator))return reply(lang.adminOnly())
}
global.db.data.absen = global.db.data.absen || {}
if (!(from in global.db.data.absen))return alpha.send1ButMes(m.chat, `Tidak ada absen berlangsung di group ini !`, `© ${ownername}`, `absenstart`, `Mulai Absen`, m)
delete global.db.data.absen[from]
reply(`Absen berhasil dihapus`)
}
break
case 'absenstart': case 'mulaiabsen':{
if (m.isGroup) {
if (!(isGroupAdmins || isCreator))return reply(lang.adminOnly())
}
global.db.data.absen = global.db.data.absen || {}
if (from in global.db.data.absen)return alpha.send2ButMes(m.chat, `Masih ada sesi absen di group ini !`, `© ${ownername}`, `cekabsen`, `Cek Absen`, `deleteabsen`, `Hapus Absen`, m)
global.db.data.absen[from] = [
await alpha.send1ButMes(m.chat, `Absen dimulai...`, `© ${ownername}`, `absen`, `Absen`, m),
[], q ? q : '']
}
break
//Database
case 'setcmd': {
global.db.data.cmd = global.db.data.cmd || {}
if (!m.quoted)return reply(`Reply stiker!!\nExample : ${prefix + command} menu\n\n\n*Note : Tidak dapat disertai Prefix!!*`)
if (!m.quoted.fileSha256)return reply('SHA256 Hash Missing')
if (!q)return reply(`Untuk Command Apa?`)
let sticker = global.db.data.cmd
let hash = m.quoted.fileSha256.toString('base64')
if (sticker[hash] && sticker[hash].locked) return reply('You have no permission to change this sticker command')
sticker[hash] = {
q,
mentionedJid: m.mentionedJid,
creator: m.sender,
at: + new Date,
locked: false,
}
reply(`Done!`)
}
break
case 'delcmd': {
let hash = m.quoted.fileSha256.toString('base64')
if (!hash)return reply(`Tidak ada hash`)
let sticker = global.db.data.cmd
if (sticker[hash] && sticker[hash].locked)return reply('You have no permission to delete this sticker command')
delete sticker[hash]
reply(`Done!`)
}
break
case 'listcmd': {
let teks = `
*List Hash*
Info: *bold* hash is Locked
*Hash :*
${Object.entries(global.db.data.cmd).map(([key, value], index) => `${index + 1}. ${value.locked ? `*${key}*` : key}
*Command: ${value.q}*
*Creator : @${value.creator.split("@")[0]}*
*Create Time : ${moment(value.at * 1).tz('Asia/Jakarta').format('DD/MM/YYYY HH:mm:ss')}*
*Locked : ${value.locked}*
`).join('\n')}
`.trim()
alpha.sendTextWithMentions(m.chat, teks, m)
}
break
case 'lockcmd': {
if (!isCreator)return reply('Only Onwer..')
if (!m.quoted)return reply('Reply Pesan!')
if (!m.quoted.fileSha256)return reply('SHA256 Hash Missing')
let sticker = global.db.data.cmd
let hash = m.quoted.fileSha256.toString('base64')
if (!(hash in sticker))return reply('Hash not found in database')
sticker[hash].locked = !/^un/i.test(command)
reply('Done!')
}
break
case 'addmsg': {
if (!m.quoted) return reply('Reply Message Yang Ingin Disave Di Database')
if (!text) return reply(`Example : ${prefix + command} nama file`)
let msgs = JSON.parse(fs.readFileSync('./database/database.json'))
if (text.toLowerCase() in msgs) return reply(`'${text}' telah terdaftar di list pesan`)
msgs[text.toLowerCase()] = quoted.fakeObj
fs.writeFileSync('./database/database.json', JSON.stringify(msgs))
reply(`Berhasil menambahkan pesan di list pesan sebagai '${text}'
Akses dengan ${prefix}getmsg ${text}
Lihat list Pesan Dengan ${prefix}listmsg`)
}
break
case 'getmsg': {
if (!text) reply(`Example : ${prefix + command} file name\n\nLihat list pesan dengan ${prefix}listmsg`)
let msgs = JSON.parse(fs.readFileSync('./database/database.json'))
if (!(text.toLowerCase() in msgs)) reply(`'${text}' tidak terdaftar di list pesan`)
alpha.copyNForward(m.chat, msgs[text.toLowerCase()], true)
}
break
case 'listmsg': {
let msgs = JSON.parse(fs.readFileSync('./database/database.json'))
let seplit = Object.entries(msgs).map(([nama, isi]) => { return { nama, ...isi } })
let teks = '「 LIST DATABASE 」\n\n'
for (let i of seplit) {
teks += `⬡ *Name :* ${i.nama}\n⬡ *Type :* ${Object.keys(i.message)[0]}\n────────────────────────\n\n`
}
reply(teks)
}
break
case 'delmsg': case 'deletemsg': {
let msgs = JSON.parse(fs.readFileSync('./database/database.json'))
if (!(text.toLowerCase() in msgs)) return reply(`'${text}' tidak terdaftar didalam list pesan`)
delete msgs[text.toLowerCase()]
fs.writeFileSync('./database/database.json', JSON.stringify(msgs))
reply(`Berhasil menghapus '${text}' dari list pesan`)
}
break
case 'antiviewonce': case 'antionce':
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
if (args[0] === "on") {
if (global.db.data.chats[m.chat].antionce) return reply(`Sudah Aktif Sebelumnya`)
global.db.data.chats[m.chat].antionce = true
reply(`${command} Berhasil Di Aktifkan !`)
} else if (args[0] === "off") {
if (!global.db.data.chats[m.chat].antionce) return reply(`Sudah Nonaktif Sebelumnya`)
global.db.data.chats[m.chat].antionce = false
reply(`${command} Berhasil Di Nonaktifkan !`)
} else {
alpha.sendButMessage(from, 'Mode Anti View Once', `© ${ownername}`, [{buttonId: 'antionce on', buttonText: {displayText: 'ON'}, type: 1},{buttonId: 'antionce off', buttonText: {displayText: 'OFF'}, type: 1}], {quoted: fgif})
}
break
case 'autorespond': case 'autorespon': {
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
if (args[0] === "on") {
if (global.db.data.settings[botNumber].autorespond) return reply(`Sudah Aktif Sebelumnya`)
global.db.data.settings[botNumber].autorespond = true
reply(`${command} Berhasil Di Aktifkan !`)
} else if (args[0] === "off") {
if (!global.db.data.settings[botNumber].autorespond) return reply(`Sudah Nonaktif Sebelumnya`)
global.db.data.settings[botNumber].autorespond = false
reply(`${command} Berhasil Di Nonaktifkan !`)
} else {
alpha.sendButMessage(from, 'Mode Auto Respond', `© ${ownername}`, [{buttonId: 'autorespond on', buttonText: {displayText: 'ON'}, type: 1},{buttonId: 'autorespond off', buttonText: {displayText: 'OFF'}, type: 1}], {quoted: fgif})
}}
break
case 'nsfw':
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
if (args[0] === "on") {
if (global.db.data.chats[m.chat].nsfw) return reply(`Sudah Aktif Sebelumnya`)
global.db.data.chats[m.chat].nsfw = true
reply(`NsFw Berhasil Di Aktifkan !`)
} else if (args[0] === "off") {
if (!global.db.data.chats[m.chat].nsfw) return reply(`Sudah Nonaktif Sebelumnya`)
global.db.data.chats[m.chat].nsfw = false
reply(`NsFw Berhasil Di Nonaktifkan !`)
} else {
alpha.sendButMessage(from, 'Mode Nfsw', `© ${ownername}`, [{buttonId: 'nsfw on', buttonText: {displayText: 'ON'}, type: 1},{buttonId: 'nsfw off', buttonText: {displayText: 'OFF'}, type: 1}], {quoted: fgif})
}
break
case 'antilink':
if (!m.isGroup) return reply(lang.groupOnly())
if (!isGroupAdmins && !isGroupOwner && !isCreator) return reply(lang.adminOnly())
if (!isBotAdmins) return reply(lang.botNotAdmin())
if (args[0] === "on") {
if (global.db.data.chats[m.chat].antilink) return reply('Sudah Aktif Sebelumnya')
global.db.data.chats[m.chat].antilink = true
reply(`Antilink Berhasil Di Aktifkan !`)
} else if (args[0] === "off") {
if (!global.db.data.chats[m.chat].antilink) return reply('Sudah Nonaktif Sebelumnya')
global.db.data.chats[m.chat].antilink = false
reply(`Antilink Berhasil Di Nonaktifkan !`)
} else {
alpha.sendButMessage(from, 'Mode Antilink', `© ${ownername}`, [{buttonId: 'antilink on', buttonText: {displayText: 'ON'}, type: 1},{buttonId: 'antilink off', buttonText: {displayText: 'OFF'}, type: 1}], {quoted: fgif})
}
break
case 'chat': {
if (!m.key.fromMe && !isCreator) throw mess.owner
if (!q) throw 'Option : 1. mute\n2. unmute\n3. archive\n4. unarchive\n5. read\n6. unread\n7. delete'
if (args[0] === 'mute') {
alpha.chatModify({ mute: 'Infinity' }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'unmute') {
alpha.chatModify({ mute: null }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'archive') {
alpha.chatModify({ archive: true }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'unarchive') {
alpha.chatModify({ archive: false }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'read') {
alpha.chatModify({ markRead: true }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'unread') {
alpha.chatModify({ markRead: false }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
} else if (args[0] === 'delete') {
alpha.chatModify({ clear: { message: { id: m.quoted.id, fromMe: true }} }, m.chat, []).then((res) => reply(jsonformat(res))).catch((err) => reply(jsonformat(err)))
}
}
break
case 'linkgroup': case 'linkgrup': case 'linkgc': {
if (!m.isGroup) throw mess.group
let response = await alpha.groupInviteCode(m.chat)
alpha.sendText(m.chat, `Link Group : *${groupMetadata.subject}*\nhttps://chat.whatsapp.com/${response}`, m, { detectLink: true })
}
break
case 'delete': case 'del': {
if (!m.key.fromMe && !isCreator) throw mess.owner
if (!m.quoted) throw false
let { chat, fromMe, id, isBaileys } = m.quoted
if (!isBaileys) throw 'Pesan tersebut bukan dikirim oleh bot!'
alpha.sendMessage(m.chat, { delete: { remoteJid: m.chat, fromMe: true, id: m.quoted.id, participant: m.quoted.sender } })
}
break
case 'toimage': case 'toimg': {
if (!quoted) throw 'Reply Image'
if (!/webp/.test(mime)) throw `Reply Sticker Dengan Caption *${prefix + command}*`
reply(lang.wait())
let media = await alpha.downloadAndSaveMediaMessage(quoted)
let ran = await getRandom('.png')
exec(`ffmpeg -i ${media} ${ran}`, (err) => {
fs.unlinkSync(media)
if (err) throw 'Maaf Saat Ini Belum Support Sticker Gif '
let buffer = fs.readFileSync(ran)
alpha.sendMessage(m.chat, { image: buffer }, { quoted: m })
fs.unlinkSync(ran)
})
}
break
case 'pinterest': {
if (!q) return reply(lang.wrongFormat(prefix))
reply(lang.wait())
anu = await pinterest(text)
result = anu[Math.floor(Math.random(), anu.length)]
let gam = await getBuffer(result)
var but = [
{
"urlButton": {
"displayText": "Media Url",
"url": `${result}`
}
}
]
await alpha.send5ButImg(from, `Hasil percarian ${text}` , `© ${ownername}`,gam, but , { userJid: m.chat, quoted: m })
.catch((err) => {
reply(lang.err())
})
}
break
case 'wallpaper': {
if (!q) return reply(lang.wrongFormat(prefix))
reply(lang.wait())
wallpaper(text).then( async anu =>{
result = anu[Math.floor(Math.random(), anu.length)]
let gam = await getBuffer(result.image[0])
var but = [
{
"urlButton": {
"displayText": "Website",
"url": `${myweb}`
}
}
]
await alpha.send5ButImg(from, `⭔ Title : ${result.title}\n⭔ Source : ${result.source}\n⭔ Media Url : ${result.image}` , `© ${ownername}`,gam, but , { userJid: m.chat, quoted: m })
})
.catch((err) => {
reply(lang.err())
})
}
break
case 'wikimedia': {
if (!q) return reply(lang.wrongFormat(prefix))
reply(lang.wait())
wikimedia(text).then( async anu =>{
result = anu[Math.floor(Math.random(), anu.length)]
let gam = await getBuffer(result.image[0])
var but = [
{
"urlButton": {
"displayText": "Website",
"url": `${myweb}`
}
}
]
await alpha.send5ButImg(from, `⭔ Title : ${result.title}\n⭔ Source : ${result.source}\n⭔ Media Url : ${result.image}` , `© ${ownername}`,gam, but , { userJid: m.chat, quoted: m })
})
.catch((err) => {
reply(lang.err())
})
}
break
case 'quotesanime': case 'quoteanime': {
reply(lang.wait())
quotesAnime().then(async anu =>{
gam = await getBuffer(picak + 'quotes anime')
result = anu[Math.floor(Math.random(), anu.length)]
alpha.send5ButLoc(m.chat, `_${result.quotes}_\n\nBy *'${result.karakter}'*, ${result.anime}\n\n*_- ${result.up_at}_*` , '©' + ownername, gam, [{"quickReplyButton": {"displayText": "Next Quotes","id": 'quotesanime'}}], {quoted:m})
})
}
break
case 'tes': case 'runtime':
reply(`Runtime : ${runtime(process.uptime())}`)
break
case 'public': {
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
alpha.public = true
reply('Sukses Ganti Ke Mode Public')
}
break
case 'self': {
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
alpha.public = false
reply('Sukses Ganti Ke Mode Self\n\nUntuk mengubah ke mode public silahkan gunakan nomor bot')
}
break
case 'ping': case 'botstatus': case 'statusbot': {
let timestamp = speed()
let latensi = speed() - timestamp
neww = performance.now()
oldd = performance.now()
respon = `
Kecepatan Respon ${latensi.toFixed(4)} _Detik_ \n ${oldd - neww} _milidetik_\n\nRuntime : ${runtime(process.uptime())}
💻 Info Server
RAM: ${formatp(os.totalmem() - os.freemem())} / ${formatp(os.totalmem())}
_NodeJS Memory Usaage_
${Object.keys(used).map((key, _, arr) => `${key.padEnd(Math.max(...arr.map(v=>v.length)),' ')}: ${formatp(used[key])}`).join('\n')}
${cpus[0] ? `_Total CPU Usage_
${cpus[0].model.trim()} (${cpu.speed} MHZ)\n${Object.keys(cpu.times).map(type => `- *${(type + '*').padEnd(6)}: ${(100 * cpu.times[type] / cpu.total).toFixed(2)}%`).join('\n')}
_CPU Core(s) Usage (${cpus.length} Core CPU)_
${cpus.map((cpu, i) => `${i + 1}. ${cpu.model.trim()} (${cpu.speed} MHZ)\n${Object.keys(cpu.times).map(type => `- *${(type + '*').padEnd(6)}: ${(100 * cpu.times[type] / cpu.total).toFixed(2)}%`).join('\n')}`).join('\n\n')}` : ''}
`.trim()
reply(respon)
}
break
case 'owner': case 'creator': {
let vcard = 'BEGIN:VCARD\n' // metadata of the contact card
+ `VERSION:3.0\n`
+ `N:;${ownername}.;;;`
+ `FN:${ownername}.\n` // full name
+ `ORG:Owner ${botname};\n` // the organization of the contact
+ `TEL;type=CELL;type=VOICE;waid=${ownernomer}:${ownernomerr}\n`
+ 'END:VCARD'
alpha.sendMessage(m.chat, { contacts: { displayName: 'Zeeone Ofc.', contacts: [{ vcard }] } }, { quoted: m })
}
break
case 'rules':{
let gam = await getBuffer(picak + 'Syarat Dan Ketentuan')
var but = [
{
"urlButton": {
"displayText": "Website",
"url": `${myweb}`
}
}
]
await alpha.send5ButImg(from, lang.rules(prefix), `© ${ownername}`,gam, but , { userJid: m.chat, quoted: m })
}
break
case 'donasi': case 'donate':{
var but = [
{
"urlButton": {
"displayText": "YouTube Creator",
"url": `${youtube}`
}
},
{
"urlButton": {
"displayText": "Rest Api's",
"url": `${myweb}`
}
},
{
"quickReplyButton": {
"displayText": "Rules",
"id": 'rules'
}
},
{
"quickReplyButton": {
"displayText": "Owner",
"id": 'owner'
}
},
{
"quickReplyButton": {
"displayText": "List Command",
"id": 'command'
}
}
]
await alpha.send5ButImg(from, lang.tos(ownernomer) , `© ${ownername}`,qris, but , { userJid: m.chat, quoted: m })
}
break
//Random Anime
case 'cry':case 'kill':case 'hug':case 'pat':case 'lick':case 'kiss':case 'bite':case 'yeet':case 'neko':case 'bully':case 'bonk':case 'wink':case 'poke':case 'nom':case 'slap':case 'smile':case 'wave':case 'awoo':case 'blush':case 'smug':case 'glomp':case 'happy':case 'dance':case 'cringe':case 'cuddle':case 'highfive':case 'shinobu':case 'megumin':case 'handhold':
reply(lang.wait())
axios.get(`https://api.waifu.pics/sfw/${command}`)
.then(({data}) => {
alpha.sendMediaAsSticker(m.chat, data.url, m, { packname: global.packname, author: global.author })
})
break
case 'waifu': case 'loli':
reply(lang.wait())
axios.get(`https://api.waifu.pics/sfw/waifu`)
.then(({data}) => {
alpha.sendImage(m.chat, data.url, lang.ok(), m)
})
break
case 'stikerin':case 's': case 'sticker': case 'stiker': {
if (!quoted) return reply(`Kirim/Reply Gambar/Video Dengan Caption ${prefix + command}\n\nDurasi Sticker Video 1-9 Detik☕`)
if (/image/.test(mime)) {
let media = await quoted.download()
let encmedia = await alpha.sendImageAsSticker(m.chat, media, m, { packname: global.packname, author: global.author })
await fs.unlinkSync(encmedia)
} else if (/video/.test(mime)) {
if ((quoted.msg || quoted).seconds > 11) return reply(`Kirim/Reply Gambar/Video Dengan Caption ${prefix + command}\n\nDurasi Sticker Video 1-9 Detik☕`)
let media = await quoted.download()
let encmedia = await alpha.sendVideoAsSticker(m.chat, media, m, { packname: global.packname, author: global.author })
await fs.unlinkSync(encmedia)
} else {
reply(`Kirim/Reply Gambar/Video Dengan Caption ${prefix + command}\n\nDurasi Sticker Video 1-9 Detik☕`)
}
}
break
case 'setprofile': case 'setpp': {
if (!m.key.fromMe && !isCreator) return reply(lang.ownerOnly())
if (!quoted) throw 'Reply Image'
if (/image/.test(mime)) throw `balas image dengan caption *${prefix + command}*`
let media = await alpha.downloadAndSaveMediaMessage(quoted)
if (!m.isGroup && !isBotAdmins && !isGroupAdmins) {
await alpha.updateProfilePicture(m.chat, { url: media }).catch((err) => fs.unlinkSync(media))
await fs.unlinkSync(media)
} else if (!isCreator) {
await alpha.updateProfilePicture(alpha.user.id, { url: media }).catch((err) => fs.unlinkSync(media))
await fs.unlinkSync(media)
}
}
break
case 'webtonsearch': case 'webtoon':
if (!q) return reply(lang.wrongFormat(prefix))
await reply(lang.wait())
zee.Webtoons(q).then(async data => {
let txt = `*------「 WEBTOONS-SEARCH 」------*\n\n`
for (let i of data) {
txt += `*📫 Title :* ${i.judul}\n`
txt += `*👍🏻 Like :* ${i.like}\n`
txt += `*🤴🏻 Creator :* ${i.creator}\n`
txt += `*🎥 Genre :* ${i.genre}\n`
txt += `*📚 Url :* ${i.url}\n ----------------------------------------------------------\n`
}
await reply(txt)
})
.catch((err) => {
reply(lang.err())
})
break
case 'drakor':
if (!q) return reply(lang.wrongFormat(prefix))
await reply(lang.wait())
zee.Drakor(`${text}`).then(async data => {
let txt = `*-----「 DRAKOR-SEARCH 」-----*\n\n`
for (let i of data) {
txt += `*📫 Title :* ${i.judul}\n`
txt += `*📆 Years :* ${i.years}\n`
txt += `*🎥 Genre :* ${i.genre}\n`
txt += `*📚 Url :* ${i.url}\n-----------------------------------------------------\n`
}
await sendFileFromUrl(from,data[0].thumbnail,txt,m)
})
.catch((err) => {
reply(lang.err())
})
break
case 'anime':{
if (!q) return reply(lang.wrongFormat(prefix))
await reply(lang.wait())
zee.Anime(q).then(async data => {
let txt = `*-------「 ANIME-SEARCH 」-------*\n\n`
for (let i of data) {
txt += `*📫 Title :* ${i.judul}\n`
txt += `*📚 Url :* ${i.link}\n-----------------------------------------------------\n`
}
let gam = await getBuffer(data[0].thumbnail.replace('https://www.anime-planet.com',''))
var but = [
{
"urlButton": {
"displayText": "Website",
"url": `${myweb}`
}
}
]
await alpha.send5ButLoc(from, txt , `© ${ownername}`,gam, but , { userJid: m.chat, quoted: m })
})
.catch((err) => {
reply(lang.err())
})
}
break
case 'character': case 'karakter':
if (!q) return reply(lang.wrongFormat(prefix))
await reply(lang.wait())
zee.Character(q).then(async data => {
let txt = `*---「 CHARACTER-SEARCH 」---*\n\n`
for (let i of data) {
txt += `*📫 Character :* ${i.character}\n`
txt += `*📚 Url :* ${i.link}\n-----------------------------------------------------\n`
}
let gam = await getBuffer(data[0].thumbnail.replace('https://www.anime-planet.com',''))