-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js.bak
1908 lines (1843 loc) · 93.3 KB
/
index.js.bak
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
// SC NYA JANGAN DI JUAL NGENTOD
// Recode Vall Popaye
const
{
WAConnection,
MessageType,
Presence,
MessageOptions,
Mimetype,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
WA_DEFAULT_EPHEMERAL,
ReconnectMode,
ProxyAgent,
GroupSettingChange,
waChatKey,
mentionedJid,
processTime,
} = require("@adiwajshing/baileys")
const hx = require('hxz-api')
const qrcode = require("qrcode-terminal")
const moment = require("moment-timezone")
const speed = require('performance-now')
const request = require('request');
const imgbb = require('imgbb-uploader')
const { spawn, exec, execSync } = require("child_process")
const fs = require("fs")
const axios = require("axios")
const ffmpeg = require('fluent-ffmpeg')
const { EmojiAPI } = require("emoji-api");
const ig = require('insta-fetcher')
const emoji = new EmojiAPI()
const fetch = require('node-fetch');
const phoneNum = require('awesome-phonenumber')
const gis = require('g-i-s');
const got = require("got");
const imageToBase64 = require('image-to-base64');
const ID3Writer = require('browser-id3-writer');
const brainly = require('brainly-scraper')
const yts = require( 'yt-search')
const ms = require('parse-ms')
const toMs = require('ms')
const { error } = require("qrcode-terminal")
const { getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('./lib/functions')
const { color, bgcolor } = require('./lib/color')
const { fetchJson, getBase64, kyun, createExif } = require('./lib/fetcher')
const { yta, ytv, igdl, upload, formatDate } = require('./lib/ytdl')
const { webp2mp4File} = require('./lib/webp2mp4')
const { cmdadd } = require('./lib/totalcmd.js')
const time = moment().tz('Asia/Jakarta').format("HH:mm:ss")
const afk = JSON.parse(fs.readFileSync('./lib/off.json'))
const { sleep, isAfk, cekafk, addafk } = require('./lib/offline')
const voting = JSON.parse(fs.readFileSync('./lib/voting.json'))
const { addVote, delVote } = require('./lib/vote')
const { y2mateA, y2mateV } = require('./lib/y2mate')
const { jadibot, stopjadibot, listjadibot } = require('./lib/jadibot')
let _scommand = JSON.parse(fs.readFileSync('./database/scommand.json'))
banChats = true
offline = false
ownerNumber = ["@6281314050985"]
targetpc = '6283833310095'
owner = '623833310095'
fake = 'Follow Bang :\n Vall Popaye'
numbernye = '0'
waktu = '-'
alasan = '-'
const vcard = 'BEGIN:VCARD\n'
+ 'VERSION:3.0\n'
+ 'FN:Vall Popaye\n'
+ 'ORG:YNTKTS;\n'
+ 'TEL;type=CELL;type=VOICE;waid=6281314050985:+62 813-1405-0985\n'
+ 'END:VCARD'
//=================================================//
const time2 = moment().tz('Asia/Jakarta').format('HH:mm:ss')
if(time2 < "23:59:00"){
var ucapanWaktu = 'Selamat malam 🌃'
}
if(time2 < "19:00:00"){
var ucapanWaktu = 'Selamat senja 🌆'
}
if(time2 < "18:00:00"){
var ucapanWaktu = 'Selamat sore 🌆'
}
if(time2 < "15:00:00"){
var ucapanWaktu = 'Selamat siang 🏙️'
}
if(time2 < "11:00:00"){
var ucapanWaktu = 'Selamat pagi 🌇'
}
if(time2 < "06:00:00"){
var ucapanWaktu = 'Selamat pagi 🌅' }
//=================================================//
// Sticker Cmd
// Funcation Stick Cmd , Sorry Bang saya Encrip hehe:)
function _0x187e(){const _0x5201c3=['354332XZSVKt','stringify','10gXCFmS','writeFileSync','chats','826660vMhFZs','push','831785OvEahb','9YWQYLr','30yImjxS','6342256ZSdPUT','2360940FsKSew','forEach','333777enEhHA','keys','5973359gTLRyl'];_0x187e=function(){return _0x5201c3;};return _0x187e();}function _0x53ad(_0x327943,_0x496650){const _0x187e5a=_0x187e();return _0x53ad=function(_0x53ad6b,_0x638151){_0x53ad6b=_0x53ad6b-0x7b;let _0x56c9cd=_0x187e5a[_0x53ad6b];return _0x56c9cd;},_0x53ad(_0x327943,_0x496650);}(function(_0x5c82b1,_0x583797){const _0x404869=_0x53ad,_0x5daaac=_0x5c82b1();while(!![]){try{const _0x4771ab=-parseInt(_0x404869(0x88))/0x1+parseInt(_0x404869(0x8a))/0x2*(parseInt(_0x404869(0x85))/0x3)+-parseInt(_0x404869(0x83))/0x4+parseInt(_0x404869(0x7f))/0x5*(-parseInt(_0x404869(0x81))/0x6)+parseInt(_0x404869(0x87))/0x7+parseInt(_0x404869(0x82))/0x8+-parseInt(_0x404869(0x80))/0x9*(-parseInt(_0x404869(0x7d))/0xa);if(_0x4771ab===_0x583797)break;else _0x5daaac['push'](_0x5daaac['shift']());}catch(_0x52bd20){_0x5daaac['push'](_0x5daaac['shift']());}}}(_0x187e,0x7c338));const addCmd=(_0x36813b,_0x481a74)=>{const _0x5c67d7=_0x53ad,_0x3aa4ea={'id':_0x36813b,'chats':_0x481a74};_scommand[_0x5c67d7(0x7e)](_0x3aa4ea),fs[_0x5c67d7(0x7b)]('./database/scommand.json',JSON[_0x5c67d7(0x89)](_scommand));},getCommandPosition=_0x467b73=>{const _0xde6c6=_0x53ad;let _0x564579=null;Object[_0xde6c6(0x86)](_scommand)[_0xde6c6(0x84)](_0x12d946=>{_scommand[_0x12d946]['id']===_0x467b73&&(_0x564579=_0x12d946);});if(_0x564579!==null)return _0x564579;},getCmd=_0x2ac48e=>{const _0x252724=_0x53ad;let _0x3b3ee6=null;Object[_0x252724(0x86)](_scommand)[_0x252724(0x84)](_0x2c0eb9=>{_scommand[_0x2c0eb9]['id']===_0x2ac48e&&(_0x3b3ee6=_0x2c0eb9);});if(_0x3b3ee6!==null)return _scommand[_0x3b3ee6][_0x252724(0x7c)];},checkSCommand=_0x214db0=>{const _0x4d3d7e=_0x53ad;let _0x597323=![];return Object[_0x4d3d7e(0x86)](_scommand)['forEach'](_0x2b847a=>{_scommand[_0x2b847a]['id']===_0x214db0&&(_0x597323=!![]);}),_0x597323;};
module.exports = hexa = async (hexa, mek) => {
try {
if (!mek.hasNewMessage) return
mek = mek.messages.all()[0]
if (!mek.message) return
if (mek.key && mek.key.remoteJid == 'status@broadcast') return
global.blocked
mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
const content = JSON.stringify(mek.message)
const from = mek.key.remoteJid
const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType
const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')
const timeWib = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')
const timeWit= moment().tz('Asia/Makassar').format('DD/MM HH:mm:ss')
const timeWita = moment().tz('Asia/Jayapura').format('DD/MM HH:mm:ss')
const type = Object.keys(mek.message)[0]
const cmd = (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 : ''.slice(1).trim().split(/ +/).shift().toLowerCase()
const prefix = /^[°•π÷׶∆£¢€¥®™=|~!#$%^&.?/\\©^z+*@,;]/.test(cmd) ? cmd.match(/^[°•π÷׶∆£¢€¥®™=|~!#$%^&.?/\\©^z+*,;]/gi) : '-'
body = (type === 'conversation' && mek.message.conversation.startsWith(prefix)) ? mek.message.conversation : (type == 'imageMessage') && mek.message[type].caption.startsWith(prefix) ? mek.message[type].caption : (type == 'videoMessage') && mek.message[type].caption.startsWith(prefix) ? mek.message[type].caption : (type == 'extendedTextMessage') && mek.message[type].text.startsWith(prefix) ? mek.message[type].text : (type == 'listResponseMessage') && mek.message[type].singleSelectReply.selectedRowId ? mek.message[type].singleSelectReply.selectedRowId : (type == 'buttonsResponseMessage') && mek.message[type].selectedButtonId ? mek.message[type].selectedButtonId : (type == 'stickerMessage') && (getCmd(mek.message[type].fileSha256.toString('base64')) !== null && getCmd(mek.message[type].fileSha256.toString('base64')) !== undefined) ? getCmd(mek.message[type].fileSha256.toString('base64')) : ""
budy = (type === 'conversation') ? mek.message.conversation : (type === 'extendedTextMessage') ? mek.message.extendedTextMessage.text : ''
const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const isCmd = body.startsWith(prefix)
const q = args.join(' ')
const botNumber = hexa.user.jid
const botNumberss = hexa.user.jid + '@c.us'
const isGroup = from.endsWith('@g.us')
let sender = isGroup ? mek.participant : mek.key.remoteJid
// const isSelfNumber = config.NomorSELF
// const isOwner = sender.id === isSelfNumber
const totalchat = await hexa.chats.all()
const groupMetadata = isGroup ? await hexa.groupMetadata(from) : ''
const groupName = isGroup ? groupMetadata.subject : ''
const groupId = isGroup ? groupMetadata.jid : ''
const groupMembers = isGroup ? groupMetadata.participants : ''
const groupDesc = isGroup ? groupMetadata.desc : ''
const groupOwner = isGroup ? groupMetadata.owner : ''
const groupAdmins = isGroup ? getGroupAdmins(groupMembers) : ''
const isBotGroupAdmins = groupAdmins.includes(botNumber) || false
const isGroupAdmins = groupAdmins.includes(sender) || false
const isOwner = ownerNumber.includes(sender)
const isVote = isGroup ? voting.includes(from) : false
const conts = mek.key.fromMe ? hexa.user.jid : hexa.contacts[sender] || { notify: jid.replace(/@.+/, '') }
if (isCmd) cmdadd()
const pushname = mek.key.fromMe ? hexa.user.name : conts.notify || conts.vname || conts.name || '-'
//MESS
mess = {
wait: 'Otewe',
success: 'Berhasil!',
wrongFormat: 'Format salah, coba liat lagi di menu',
error: {
stick: 'bukan sticker itu:v',
Iv: 'Linknya error:v'
},
only: {
group: 'Khusus grup ngab',
}
}
// here button function
selectedButton = (type == 'buttonsResponseMessage') ? mek.message.buttonsResponseMessage.selectedButtonId : ''
responseButton = (type == 'listResponseMessage') ? mek.message.listResponseMessage.title : ''
const listmsg = (from, title, desc, list) => { // ngeread nya pake rowsId, jadi command nya ga keliatan
let po = hexa.prepareMessageFromContent(from, {"listMessage": {"title": title,"description": desc,"buttonText": "Pilih Disini","footerText": "Jangan Lupa Donasi Ya Kak ☕","listType": "SINGLE_SELECT","sections": list}}, {})
return hexa.relayWAMessage(po, {waitForAck: true})
}
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) => {
hexa.sendMessage(from, teks, text, {quoted:fvid})
}
const textImg = (teks) => {
return hexa.sendMessage(from, teks, text, {quoted: mek, thumbnail: fs.readFileSync('./lib/vallgans.jpeg')})
}
const sendMess = (hehe, teks) => {
hexa.sendMessage(hehe, teks, text)
}
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? hexa.sendMessage(from, teks.trim(), extendedText, { contextInfo: { "mentionedJid": memberr } }) : hexa.sendMessage(from, teks.trim(), extendedText, { quoted: mek, contextInfo: { "mentionedJid": memberr } })
}
//FAKEREPLY PRODUCT
const ftoko = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: {"productMessage": {"product": {"productImage":{"mimetype": "image/jpeg","jpegThumbnail": fs.readFileSync(`./stik/thumb.jpeg`)},"title": `NGEJUDI GAK BROH?\n${pushname}`,"description": "X -hexa Team", "currencyCode": "IDR","priceAmount1000": "9999999999","retailerId": "X - hexa Team","productImageCount": 1},"businessOwnerJid": `[email protected]`}}}
//FAKE KONTAK
const fkontak = {
key: {fromMe: false,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': fs.readFileSync('./stik/thumb.jpeg')}}}
//FAKE STICKER
const fsticker = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},"message": {"stickerMessage": { "url": "https://mmg.whatsapp.net/d/f/Am6FBfNf-E2f1VoGBXkPaNAy7L6Tw_HMavKrHEt48QM4.enc","fileSha256": "Yfj8SW7liSEnDakvyVlXVZQ1LJBC9idn09X7KHe8HTc=","fileEncSha256": "F854aUrzgAkBTOVULpne4oSIi6S04Jo56pjZEo+p+9U=","mediaKey": "Z3nA2asclAAwWHngNO/vJ81qxOE2/0gkEnXak+NxPV4=","mimetype": "image/webp","height": 64,"width": 64,"directPath": "/v/t62.15575-24/12097272_1193895144391295_8973688483514349023_n.enc?ccb=11-4&oh=5a9d7147627a8355569f1a641b9ebee3&oe=60C65E73","fileLength": "7186","mediaKeyTimestamp": "1622815545","isAnimated": false}}}
//FAKE VN
const fvn = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: { "audioMessage": {"mimetype":"audio/ogg; codecs=opus","seconds": "9999999","ptt": "true"}}}
//FAKE TEXT
const ftext = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: { "extendedTextMessage": {"text": `${fake}`,"title": `Hmm`,'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}
//FAKE LIVE ACTION
const floc2 = {
key: {"fromMe": false,"participant": `[email protected]`, "remoteJid": "[email protected]" },message: { "liveLocationMessage": { "title":`${fake}`,}}}
//FAKEREPLY TROLI
const ftroli = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})},message: {orderMessage: {itemCount : 2021,status: 1,surface : 1,message: `${ucapanWaktu} Kak\n ${pushname}\n 😘`,orderTitle: 'Bang',thumbnail: fs.readFileSync('./stik/thumb.jpeg'), sellerJid: '[email protected]'}}}
const fakevn = {
key: {
fromMe: false,
participant: `[email protected]`, ...(from ?
{ remoteJid: "[email protected]" } : {})
},
message: {
"audioMessage": {
"mimetype":"audio/ogg; codecs=opus",
"seconds": "99999999999",
"ptt": "true"
}
}
}
//FAKEREPLY VIDEO
const fvideo = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {}) },message: { "videoMessage": { "title":"hallo bang","h": `Hmm`,'seconds': '-99999', 'caption': `${fake}`,'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}
const fvid = {
key: {
participant: '[email protected]'
},
message: {
"videoMessage": {
"title":"hallo bang",
"h": `Hmm`,
'seconds': '99',
'caption': 'Bokep fripayer',
'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')
}
}
}
//FAKEREPLY GROUPINVITE
const fgc = {
key: {"fromMe": false,"participant": "[email protected]","remoteJid": "[email protected]"},"message": {"groupInviteMessage": {"groupJid": "[email protected]","inviteCode": "mememteeeekkeke","groupName": "P", "caption": `${fake}`, 'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}
//FAKEREPLY GIF
const fgif = {
key: {fromMe: false,participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {}) },message: { "videoMessage": { "title":"hallo bang","h": `Hmm`,'seconds': '99999', 'gifPlayback': 'true', 'caption': `${fake}`,'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}
const fakestatus = (teks) => {
hexa.sendMessage(from, teks, text, {
quoted: {
key: {
fromMe: false,
participant: `[email protected]`, ...(from ? { remoteJid: "status@broadcast" } : {})
},
message: {
"imageMessage": {
"url": "https://mmg.whatsapp.net/d/f/At0x7ZdIvuicfjlf9oWS6A3AR9XPh0P-hZIVPLsI70nM.enc",
"mimetype": "image/jpeg",
"caption": fake,
"fileSha256": "+Ia+Dwib70Y1CWRMAP9QLJKjIJt54fKycOfB2OEZbTU=",
"fileLength": "28777",
"height": 1080,
"width": 1079,
"mediaKey": "vXmRR7ZUeDWjXy5iQk17TrowBzuwRya0errAFnXxbGc=",
"fileEncSha256": "sR9D2RS5JSifw49HeBADguI23fWDz1aZu4faWG/CyRY=",
"directPath": "/v/t62.7118-24/21427642_840952686474581_572788076332761430_n.enc?oh=3f57c1ba2fcab95f2c0bb475d72720ba&oe=602F3D69",
"mediaKeyTimestamp": "1610993486",
"jpegThumbnail": fs.readFileSync('./stik/thumb.jpeg'),
"scansSidecar": "1W0XhfaAcDwc7xh1R8lca6Qg/1bB4naFCSngM2LKO2NoP5RI7K+zLw=="
}
}
}
})
}
const fakethumb = (teks, yes) => {
hexa.sendMessage(from, teks, image, {thumbnail:fs.readFileSync('./stik/fake.jpeg'),quoted:mek,caption:yes})
}
const fakegroup = (teks) => {
hexa.sendMessage(from, teks, text, {
quoted: {
key: {
fromMe: false,
participant: `[email protected]`, ...(from ? { remoteJid: "[email protected]" } : {})
},
message: {
"imageMessage": {
"url": "https://mmg.whatsapp.net/d/f/At0x7ZdIvuicfjlf9oWS6A3AR9XPh0P-hZIVPLsI70nM.enc",
"mimetype": "image/jpeg",
"caption": fake,
"fileSha256": "+Ia+Dwib70Y1CWRMAP9QLJKjIJt54fKycOfB2OEZbTU=",
"fileLength": "28777",
"height": 1080,
"width": 1079,
"mediaKey": "vXmRR7ZUeDWjXy5iQk17TrowBzuwRya0errAFnXxbGc=",
"fileEncSha256": "sR9D2RS5JSifw49HeBADguI23fWDz1aZu4faWG/CyRY=",
"directPath": "/v/t62.7118-24/21427642_840952686474581_572788076332761430_n.enc?oh=3f57c1ba2fcab95f2c0bb475d72720ba&oe=602F3D69",
"mediaKeyTimestamp": "1610993486",
"jpegThumbnail": fs.readFileSync('./stik/thumb.jpeg'),
"scansSidecar": "1W0XhfaAcDwc7xh1R8lca6Qg/1bB4naFCSngM2LKO2NoP5RI7K+zLw=="
}
}
}
})
}
const sendStickerFromUrl = async(to, url) => {
var names = Date.now() / 10000;
var download = function (uri, filename, callback) {
request.head(uri, function (err, res, body) {
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
};
download(url, './stik' + names + '.png', async function () {
console.log('selesai');
let filess = './stik' + names + '.png'
let asw = './stik' + names + '.webp'
exec(`ffmpeg -i ${filess} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${asw}`, (err) => {
let media = fs.readFileSync(asw)
hexa.sendMessage(to, media, MessageType.sticker,{quoted:mek})
fs.unlinkSync(filess)
fs.unlinkSync(asw)
});
});
}
const sendFileFromUrl = async(link, type, options) => {
hasil = await getBuffer(link)
hexa.sendMessage(from, hasil, type, options).catch(e => {
fetch(link).then((hasil) => {
hexa.sendMessage(from, hasil, type, options).catch(e => {
hexa.sendMessage(from, { url : link }, type, options).catch(e => {
reply('_[ ! ] Error Gagal Dalam Mendownload Dan Mengirim Media_')
console.log(e)
})
})
})
})
}
const sendMediaURL = async(to, url, text="", mids=[]) =>{
if(mids.length > 0){
text = normalizeMention(to, text, mids)
}
const fn = Date.now() / 10000;
const filename = fn.toString()
let mime = ""
var download = function (uri, filename, callback) {
request.head(uri, function (err, res, body) {
mime = res.headers['content-type']
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
};
download(url, filename, async function () {
console.log('done');
let media = fs.readFileSync(filename)
let type = mime.split("/")[0]+"Message"
if(mime === "image/gif"){
type = MessageType.video
mime = Mimetype.gif
}
if(mime.split("/")[0] === "audio"){
mime = Mimetype.mp4Audio
}
hexa.sendMessage(to, media, type, { quoted: mek, mimetype: mime, caption: text,contextInfo: {"mentionedJid": mids}})
fs.unlinkSync(filename)
});
}
//FUNCTION
cekafk(afk)
if (!mek.key.remoteJid.endsWith('@g.us') && offline){
if (!mek.key.fromMe){
if (isAfk(mek.key.remoteJid)) return
addafk(mek.key.remoteJid)
heheh = ms(Date.now() - waktu)
hexa.sendMessage(mek.key.remoteJid,`@${owner} Sedang Offline!\n\n*Alasan :* ${alasan}\n*Sejak :* ${heheh.hours} Jam, ${heheh.minutes} Menit, ${heheh.seconds} Detik lalu\n\nSilahkan Hubungi Lagi Nanti`, MessageType.text,{contextInfo:{ mentionedJid: [`${owner}@s.whatsapp.net`],'stanzaId': "B826873620DD5947E683E3ABE663F263", 'participant': "[email protected]", 'remoteJid': 'status@broadcast', 'quotedMessage': {"imageMessage": {"caption": "*OFFLINE*", 'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}})
}
}
if (mek.key.remoteJid.endsWith('@g.us') && offline) {
if (!mek.key.fromMe){
if (mek.message.extendedTextMessage != undefined){
if (mek.message.extendedTextMessage.contextInfo != undefined){
if (mek.message.extendedTextMessage.contextInfo.mentionedJid != undefined){
for (let ment of mek.message.extendedTextMessage.contextInfo.mentionedJid) {
if (ment === `${owner}@s.whatsapp.net`){
if (isAfk(mek.key.remoteJid)) return
addafk(mek.key.remoteJid)
heheh = ms(Date.now() - waktu)
hexa.sendMessage(mek.key.remoteJid,`@${owner} Sedang Offline!\n\n *Alasan :* ${alasan}\n *Sejak :* ${heheh.hours} Jam, ${heheh.minutes} Menit, ${heheh.seconds} Detik lalu\n\nSilahkan Hubungi Lagi Nanti`, MessageType.text,{contextInfo:{ mentionedJid: [`${owner}@s.whatsapp.net`],'stanzaId': "B826873620DD5947E683E3ABE663F263", 'participant': "[email protected]", 'remoteJid': 'status@broadcast', 'quotedMessage': {"imageMessage": {"caption": "*OFFLINE*", 'jpegThumbnail': fs.readFileSync('./stik/thumb.jpeg')}}}})
}
}
}
}
}
}
}
//========================================================================================================================//
colors = ['red', 'white', 'black', 'blue', 'yellow', 'green']
const isMedia = (type === 'imageMessage' || type === 'videoMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
if (!isGroup && isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(command), 'from', color(sender.split('@')[0]), 'args :', color(args.length))
//if (!isGroup && !isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mTEXT\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;31mTEXT\x1b[1;37m]', time, color('Message'), 'from', color(sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length))
if(isGroup && !isVote) {
if (budy.toLowerCase() === 'vote'){
let vote = JSON.parse(fs.readFileSync(`./lib/${from}.json`))
let _votes = JSON.parse(fs.readFileSync(`./lib/vote/${from}.json`))
let fil = vote.map(v => v.participant)
let id_vote = sender ? sender : '[email protected]'
if(fil.includes(id_vote)) {
return mentions('@'+sender.split('@')[0]+' Anda sudah vote', fil, true)
} else {
vote.push({
participant: id_vote,
voting: '✅'
})
fs.writeFileSync(`./lib/${from}.json`,JSON.stringify(vote))
let _p = []
let _vote = '*Vote* '+ '@'+ _votes[0].votes.split('@')[0] + `\n\n*Alasan*: ${_votes[0].reason}\n*Jumlah Vote* : ${vote.length} Vote\n*Durasi* : ${_votes[0].durasi} Menit\n\n`
for(let i = 0; i < vote.length; i++) {
_vote += `@${vote[i].participant.split('@')[0]}\n*Vote* : ${vote[i].voting}\n\n`
_p.push(vote[i].participant)
}
_p.push(_votes[0].votes)
mentions(_vote,_p,true)
}
} else if (budy.toLowerCase() === 'devote'){
const vote = JSON.parse(fs.readFileSync(`./lib/${from}.json`))
let _votes = JSON.parse(fs.readFileSync(`./lib/vote/${from}.json`))
let fil = vote.map(v => v.participant)
let id_vote = sender ? sender : '[email protected]'
if(fil.includes(id_vote)) {
return mentions('@'+sender.split('@')[0]+' Anda sudah vote', fil, true)
} else {
vote.push({
participant: id_vote,
voting: '❌'
})
fs.writeFileSync(`./lib/${from}.json`,JSON.stringify(vote))
let _p = []
let _vote = '*Vote* '+ '@'+ _votes[0].votes.split('@')[0] + `\n\n*Alasan*: ${_votes[0].reason}\n*Jumlah Vote* : ${vote.length} Vote\n*Durasi* : ${_votes[0].durasi} Menit\n\n`
for(let i = 0; i < vote.length; i++) {
_vote += `@${vote[i].participant.split('@')[0]}\n*Vote* : ${vote[i].voting}\n\n`
_p.push(vote[i].participant)
}
_p.push(_votes[0].votes)
mentions(_vote,_p,true)
}
}
}
if (!mek.key.fromMe && banChats === true) return
switch (command) {
case 'jadibot':
if(!mek.key.fromMe) return reply('Tidak bisa jadibot di dalam bot')
jadibot(reply,hexa,from)
break
case 'stopjadibot':
if(!mek.key.fromMe)return reply('tidak bisa stopjadibot kecuali owner')
stopjadibot(reply)
break
case 'leaveall':
if (!isOwner) return
let totalgroup = hexa.chats.array.filter(u => u.jid.endsWith('@g.us')).map(u => u.jid)
for (let id of totalgroup) {
sendMess(id, 'Byee', null)
await sleep(3000)
hexa.groupLeave(id)
}
break
case 'teruskan':
hexa.sendMessage(from, `${body.slice(9)}`, MessageType.text, {contextInfo: { forwardingScore: 210, isForwarded: true }})
break
case 'listbot':
let tekss = '「 *LIST JADIBOT* 」\n'
for(let i of listjadibot) {
tekss += `*Nomor* : ${i.jid.split('@')[0]}
*Nama* : ${i.name}
*Device* : ${i.phone.device_manufacturer}
*Model* : ${i.phone.device_model}\n\n`
}
reply(tekss)
break
case 'start':
txtt =`Hai Kak ${pushname}\nPilih Opsi Dibawah Ini Ya.. `
buttons = [{buttonId:`${prefix}menu`,
buttonText:{displayText: 'Show Menu'},type:1},
{buttonId:`${prefix}owner`,buttonText:{displayText:'Owner'},type:1},
{buttonId:`${prefix}ytadmin`,buttonText:{displayText:'YouTube'},type:1}]
imageMsg = (await hexa.prepareMessageMedia(fs.readFileSync(`./lib/vallgans.jpeg`), 'imageMessage', {thumbnail: fs.readFileSync(`./lib/vallgans.jpeg`)})).imageMessage
buttonsMessage = {
contentText: `${txtt}`,
footerText: '© Creator Vall Popaye\nSupport Me By Donate Or Subscribe', imageMessage: imageMsg,
buttons: buttons,
headerType: 4
}
prep = await hexa.prepareMessageFromContent(from,{buttonsMessage},{quoted: fakevn})
hexa.relayWAMessage(prep)
break
case 'menu':
case 'help':
wew = fs.readFileSync(`./lib/vallgans.jpeg`)
var menu = `╭─❒ 「 Self Bot 」 ──────*
*│*
*│*⬡ *Hai ${ucapanWaktu}*
*│*⬡ *Nama : ${pushname}*
*│*⬡ *WIB : ${timeWib}*
*│*⬡ *WIT : ${timeWit}*
*│*⬡ *WITA : ${timeWita}*
*│*⬡ *Prefix : 「 MULTI PREFIX 」*
*│*⬡ *Bot mode : ${banChats ? "SELF-MODE" : "PUBLIC-MODE"}*
*└───────────────────*
*╭─❒ OWNER*
*│*⬡ _${prefix}off_
*│*⬡ _${prefix}on_
*│*⬡ _${prefix}bc_
*│*⬡ _${prefix}setcmd_
*│*⬡ _${prefix}delcmd_
*│*⬡ _${prefix}listcmd_
*│*⬡ _${prefix}shutdown_
*│*⬡ _${prefix}status_
*│*⬡ _${prefix}leaveall_
*│*
*├ ❒ DOWNLOAD*
*│*⬡ _${prefix}ytsearch_ <query>
*│*⬡ _${prefix}igstalk_ <query>
*│*⬡ _${prefix}play_ <query>
*│*⬡ _${prefix}video_ <query>
*│*⬡ _${prefix}ytmp3_ <link>
*│*⬡ _${prefix}ytmp4_ <link>
*│*⬡ _${prefix}ig_ <link>
*│*⬡ _${prefix}igstory_ <username>
*│*⬡ _${prefix}twitter_ <link>
*│*⬡ _${prefix}tiktok_ <link>
*│*⬡ _${prefix}tiktokaudio_ <link>
*│*⬡ _${prefix}fb_ <link>
*│*⬡ _${prefix}brainly_ <query>
*│*⬡ _${prefix}image_ <query>
*│*⬡ _${prefix}anime_ <random>
*│*⬡ _${prefix}pinterest_ <query>
*│*⬡ _${prefix}komiku_ <query>
*│*⬡ _${prefix}lirik_ <query>
*│*⬡ _${prefix}chara_ <query>
*│*⬡ _${prefix}playstore_ <query>
*│*⬡ _${prefix}otaku_ <query>
*│*
*├ ❒ MAKER*
*│*⬡ _${prefix}sticker_
*│*⬡ _${prefix}swm_ <author|packname>
*│*⬡ _${prefix}take_ <author|packname>
*│*⬡ _${prefix}fdeface_
*│*⬡ _${prefix}emoji_
*│*
*├ ❒ CONVERT*
*│*⬡ _${prefix}toimg_
*│*⬡ _${prefix}tomp3_
*│*⬡ _${prefix}tomp4_
*│*⬡ _${prefix}slow_
*│*⬡ _${prefix}fast_
*│*⬡ _${prefix}reverse_
*│*⬡ _${prefix}tourl_
*│*
*├ ❒ UP SW*
*│*⬡ _${prefix}upswteks_
*│*⬡ _${prefix}upswimage_
*│*⬡ _${prefix}upswvideo_
*│*
*├ ❒ FUN*
*│*⬡ _${prefix}fitnah_
*│*⬡ _${prefix}fitnahpc_
*│*⬡ _${prefix}teruskan_
*│*⬡ _${prefix}kontak_
*│*
*├ ❒ TAG*
*│*⬡ _${prefix}hidetag_
*│*⬡ _${prefix}kontag_
*│*⬡ _${prefix}sticktag_
*│*⬡ _${prefix}totag_
*│*
*├ ❒ OTHER*
*│*⬡ _${prefix}ping_
*│*⬡ _${prefix}inspect_
*│*⬡ _${prefix}join_
*│*⬡ _${prefix}caripesan_
*│*⬡ _${prefix}self_
*│*⬡ _${prefix}public_
*│*⬡ _${prefix}setthumb_
*│*⬡ _${prefix}settarget_
*│*⬡ _${prefix}linkwa query_
*│*⬡ _${prefix}setfakeimg_
*│*⬡ _${prefix}setreply_
*│*⬡ _${prefix}get_
*│*⬡ _${prefix}jadibot_
*│*⬡ _${prefix}listjadibot_
*│*⬡ _${prefix}voting_
*│*⬡ _${prefix}get_
*│*⬡ _${prefix}term_ <code>
*│*⬡ _x_ <code>
*│*⬡ _${prefix}delvote_
*│*⬡ _vote_
*│*⬡ _devote_
*└─────────────────*
❒ *「 Thanks To : 」*
*│*
*├ ▢ : Hexagonz*
*├ ▢ : Vall Popaye*
*├ ▢ : ARGIO DEV TEAM*
*│*
*└─────────────*
❏ *Created By Vall Popaye* ❏`
buttons = [{buttonId: `${prefix}owner`,buttonText:{displayText: 'Contact Owner'},type:1},{buttonId:`${prefix}ytadmin`,buttonText:{displayText:'YouTube'},type:1}]
buttonsMessage = {
contentText: `${menu}`,
footerText: 'Created By Vall Popaye',
buttons: buttons,
headerType: 1
}
prep = await hexa.prepareMessageFromContent(from,{buttonsMessage},{quoted: ftroli})
hexa.relayWAMessage(prep)
break
case 'owner':
case 'developer':
case 'author':
hexa.sendMessage(from, {displayname: "Jeff", vcard: vcard}, MessageType.contact, { quoted: ftroli})
.then((res) => hexa.sendMessage(from, 'Ini Kak Kontak Boss Saya😇', text, {quoted: res}))
break
case 'shutdown':
if (!mek.key.fromMe) return
reply(`Bye...`)
await sleep(3000)
process.exit()
break
case 'add':
if (args.length < 1) return reply('Yang mau di add jin ya?')
if (args[0].startsWith('08')) return reply('Gunakan kode negara kak')
try {
num = `${args[0].replace(/ /g, '')}@s.whatsapp.net`
hexa.groupAdd(from, [num])
} catch (e) {
console.log('Error :', e)
reply('Gagal menambahkan target, mungkin karena di private')
}
break
case 'ytadmin' :
reply('https://youtube.com/c/VallPopaye')
reply('subslah bang')
break
case 'buttons1':
if (args.length < 1) return reply('Link Nya Mana?')
if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)
teks = args.join(' ')
res = await y2mateA(teks)
sendFileFromUrl(res[0].link, document, {quoted: mek, mimetype: 'audio/mp3', filename: res[0].output})
break
case 'buttons2':
if (args.length < 1) return reply('Link Nya Mana?')
if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)
teks = args.join(' ')
res = await y2mateV(teks)
sendFileFromUrl(res[0].link, video, {quoted: mek, mimetype: 'video/mp4', filename: res[0].output})
break
//------------------< Sticker Cmd >-------------------
case 'addcmd':
case 'setcmd':
if (!mek.key.fromMe) return
if (isQuotedSticker) {
if (!q) return reply(`Penggunaan : ${command} cmdnya dan tag stickernya`)
var kodenya = mek.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.fileSha256.toString('base64')
addCmd(kodenya, q)
textImg("Done!")
} else {
reply('tag stickenya')
}
break
case 'delcmd':
if (!mek.key.fromMe) return
if (!isQuotedSticker) return reply(`Penggunaan : ${command} tagsticker`)
var kodenya = mek.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.fileSha256.toString('base64')
_scommand.splice(getCommandPosition(kodenya), 1)
fs.writeFileSync('./database/scommand.json', JSON.stringify(_scommand))
textImg("Done!")
break
case 'listcmd':
let teksnyee = `\`\`\`「 LIST STICKER CMD 」\`\`\``
let cemde = [];
for (let i of _scommand) {
cemde.push(i.id)
teksnyee += `\n\n➸ *ID :* ${i.id}\n➸ *Cmd* : ${i.chats}`
}
mentions(teksnyee, cemde, true)
break
case 'notif':
if (!isGroup) return reply(mess.only.group)
teks = `Notif dari @${sender.split("@")[0]}\n*Pesan : ${body.slice(7)}*`
group = await hexa.groupMetadata(from);
member = group['participants']
jids = [];
member.map(async adm => {
jids.push(adm.id.replace('c.us', 's.whatsapp.net'));
})
options = {
text: teks,
contextInfo: {
mentionedJid: jids
},
quoted: fvn
}
await hexa.sendMessage(from, options, text)
break
case 'delvote':
if(!mek.key.remoteJid) return
if(isVote) return reply('Tidak ada sesi Voting')
delVote(from)
reply('Sukses Menghapus sesi Voting Di Grup Ini')
break
case 'voting':
if(!isGroupAdmins && !mek.key.fromMe) return
if(!isGroup) return reply(mess.only.group)
if (isVote) return reply('Sesi Voting Sedang Berlangsung Di Grup Ini')
if(!q) return reply('*Voting*\n\n'+ prefix+ 'voting @tag target | reason | 1 (1 = 1 Menit)')
if (mek.message.extendedTextMessage.contextInfo.mentionedJid.length > 0 || mek.message.extendedTextMessage.contextInfo == null) {
let id = mek.message.extendedTextMessage.contextInfo.mentionedJid[0]
split = args.join(' ').replace('@', '').split('|')
if(!Number(split[2])) return reply('masukan angka di baris ke 3\nContoh: 1-9999\n1 = 1 Menit')
await mentions('Vote ' +'@'+ id.split('@')[0]+' Di Mulai' +'\n\n' + `vote = ✅\ndevote = ❌\n\nAlasan: ${split[1]}`,[id],true)
addVote(from,split[1],split[0],split[2],reply)
}
break
case 'linkwa':
if(!q) return reply('cari group apa?')
hx.linkwa(q)
.then(result => {
let res = '*「 _LINK WA_ 」*\n\n'
for (let i of result) {
res += `*Nama*: *${i.nama}\n*Link*: ${i.link}\n\n`
}
reply(res)
});
break
case 'igstory':
if(!q) return reply('Usernamenya?')
hx.igstory(q)
.then(async result => {
for(let i of result.medias){
if(i.url.includes('mp4')){
let link = await getBuffer(i.url)
hexa.sendMessage(from,link,video,{quoted: mek,caption: `Type : ${i.type}`})
} else {
let link = await getBuffer(i.url)
hexa.sendMessage(from,link,image,{quoted: mek,caption: `Type : ${i.type}`})
}
}
});
break
case 'caripesan':
if(!q)return reply('pesannya apa bang?')
let v = await hexa.searchMessages(q,from,10,1)
let s = v.messages
let el = s.filter(v => v.message)
el.shift()
try {
if(el[0].message.conversation == undefined) return
reply(`Ditemukan ${el.length} pesan`)
await sleep(3000)
for(let i = 0; i < el.length; i++) {
await hexa.sendMessage(from,'Nih pesannya',text,{quoted:el[i]})
}
} catch(e){
reply('Pesan tidak ditemukan!')
}
break
case 'lirik':
if(!q) return reply('lagu apa?')
let song = await hx.lirik(q)
sendMediaURL(from,song.thumb,song.lirik)
break
case 'otaku':
if(!q) return reply('judul animenya?')
let anime = await hx.otakudesu(q)
rem = `*Judul* : ${anime.judul}
*Jepang* : ${anime.jepang}
*Rating* : ${anime.rate}
*Produser* : ${anime.produser}
*Status* : ${anime.status}
*Episode* : ${anime.episode}
*Durasi* : ${anime.durasi}
*Rilis* : ${anime.rilis}
*Studio* : ${anime.studio}
*Genre* : ${anime.genre}\n
*Sinopsis* :
${anime.desc}\n\n*Link Batch* : ${anime.batch}\n*Link Download SD* : ${anime.batchSD}\n*Link Download HD* : ${anime.batchHD}`
ram = await getBuffer(anime.img)
hexa.sendMessage(from,ram,image,{quoted:mek,caption:rem})
break
case 'komiku':
if(!q) return reply(`judulnya?\n${prefix}komiku mao gakuin`)
let komik = await hx.komiku(q)
result = `*Title* : ${komik.title}\n
*Title Indo* : ${komik.indo}\n
*Update* : ${komik.update}\n
*Desc* : ${komik.desc}\n
*Chapter Awal* : ${komik.chapter_awal}
*Chapter Akhir* : ${komik.chapter_akhir}`
sendMediaURL(from, komik.image,result)
break
case 'chara':
if(!q) return reply(`gambar apa?\n${prefix}chara nino`)
let im = await hx.chara(q)
let acak = im[Math.floor(Math.random() * im.length)]
let li = await getBuffer(acak)
await hexa.sendMessage(from,li,image,{quoted: mek})
break
case 'pinterest':
if(!q) return reply('gambar apa?')
let pin = await hx.pinterest(q)
let ac = pin[Math.floor(Math.random() * pin.length)]
let di = await getBuffer(ac)
await hexa.sendMessage(from,di,image,{quoted: mek})
break
case 'playstore':
if(!q) return reply('lu nyari apa?')
let play = await hx.playstore(q)
let store = '❉─────────────────────❉\n'
for (let i of play){
store += `\n*「 _PLAY STORE_ 」*\n
- *Nama* : ${i.name}
- *Link* : ${i.link}\n
- *Dev* : ${i.developer}
- *Link Dev* : ${i.link_dev}\n❉─────────────────────❉`
}
reply(store)
break
case 'on':
if (!mek.key.fromMe) return
offline = false
fakestatus(' ```ANDA TELAH ONLINE``` ')
break
case 'status':
fakestatus(`*STATUS*\n${offline ? '> OFFLINE' : '> ONLINE'}\n${banChats ? '> SELF-MODE' : '> PUBLIC-MODE'}`)
break
case 'off':
if (!mek.key.fromMe) return
offline = true
waktu = Date.now()
anuu = q ? q : '-'
alasan = anuu
fakestatus(' ```ANDA TELAH OFFLINE``` ')
break
case 'get':
if(!q) return reply('linknya?')
fetch(`${args[0]}`).then(res => res.text())
.then(bu =>{
fakestatus(bu)
})
break
case 'kontag':
if (!mek.key.fromMe) return reply('SELF-BOT')
pe = args.join('')
entah = pe.split('|')[0]
nah = pe.split('|')[1]
if (isNaN(entah)) return reply('Invalid phone number');
members_ids = []
for (let mem of groupMembers) {
members_ids.push(mem.jid)
}
vcard = 'BEGIN:VCARD\n'
+ 'VERSION:3.0\n'
+ `FN:${nah}\n`
+ `TEL;type=CELL;type=VOICE;waid=${entah}:${phoneNum('+' + entah).getNumber('internasional')}\n`
+ 'END:VCARD'.trim()
hexa.sendMessage(from, {displayName: `${nah}`, vcard: vcard}, contact, {contextInfo: {"mentionedJid": members_ids}})
break
case 'sticktag':
if ((isMedia && !mek.message.videoMessage || isQuotedSticker) && args.length == 0) {
encmedia = isQuotedSticker ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
file = await hexa.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
value = args.join(" ")
var group = await hexa.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
contextInfo: { mentionedJid: mem },
quoted: mek
}
ini_buffer = fs.readFileSync(file)
hexa.sendMessage(from, ini_buffer, sticker, options)
fs.unlinkSync(file)
} else {
reply(`*Reply sticker yang sudah dikirim*`)
}
break
case 'totag':
if ((isMedia && !mek.message.videoMessage || isQuotedSticker) && args.length == 0) {
encmedia = isQuotedSticker ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
file = await hexa.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
value = args.join(" ")
var group = await hexa.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
contextInfo: { mentionedJid: mem },
quoted: mek
}
ini_buffer = fs.readFileSync(file)
hexa.sendMessage(from, ini_buffer, sticker, options)
fs.unlinkSync(file)
} else if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {
encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
file = await hexa.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
value = args.join(" ")
var group = await hexa.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
contextInfo: { mentionedJid: mem },
quoted: mek
}
ini_buffer = fs.readFileSync(file)
hexa.sendMessage(from, ini_buffer, image, options)
fs.unlinkSync(file)
} else if ((isMedia && !mek.message.videoMessage || isQuotedAudio) && args.length == 0) {
encmedia = isQuotedAudio ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
file = await hexa.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
value = args.join(" ")
var group = await hexa.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
mimetype : 'audio/mp4',
ptt : true,
contextInfo: { mentionedJid: mem },
quoted: mek
}
ini_buffer = fs.readFileSync(file)
hexa.sendMessage(from, ini_buffer, audio, options)
fs.unlinkSync(file)
} else if ((isMedia && !mek.message.videoMessage || isQuotedVideo) && args.length == 0) {
encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : mek
file = await hexa.downloadAndSaveMediaMessage(encmedia, filename = getRandom())
value = args.join(" ")
var group = await hexa.groupMetadata(from)
var member = group['participants']
var mem = []
member.map(async adm => {
mem.push(adm.id.replace('c.us', 's.whatsapp.net'))
})
var options = {
mimetype : 'video/mp4',
contextInfo: { mentionedJid: mem },
quoted: mek
}
ini_buffer = fs.readFileSync(file)
hexa.sendMessage(from, ini_buffer, video, options)
fs.unlinkSync(file)
} else{
reply(`reply gambar/sticker/audio/video dengan caption ${prefix}totag`)
}
break
case 'fitnah':
if (args.length < 1) return reply(`Usage :\n${prefix}fitnah [@tag|pesan|balasanbot]]\n\nEx : \n${prefix}fitnah @tagmember|hai|hai juga`)
var gh = args.join('')
mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid
var replace = gh.split("|")[0];
var target = gh.split("|")[1];
var bot = gh.split("|")[2];
hexa.sendMessage(from, `${bot}`, text, {quoted: { key: { fromMe: false, participant: `${mentioned}`, ...(from ? { remoteJid: from } : {}) }, message: { conversation: `${target}` }}})
break
case 'settarget':
if(!q) return reply(`${prefix}settarget 628xxxxx`)
targetpc = args[0]
fakegroup(`Succes Mengganti target fitnahpc : ${targetpc}`)
break
case 'fitnahpc':
if(!q) return reply(`${prefix}fitnahpc teks target|teks lu`)