forked from Nonamendev/Xlicon-v2
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Core.js
7169 lines (5959 loc) · 262 KB
/
Core.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
process.on("uncaughtException", console.error);
require("./config");
const fs = require('fs');
const pm2 = require('pm2');
const util = require("util");
const { promisify } = require('util');
const setTimeoutPromise = promisify(setTimeout);
const chalk = require("chalk");
const axios = require('axios');
const { spawn, exec, execSync } = require("child_process");
const moment = require("moment-timezone");
const { EmojiAPI } = require("emoji-api");
const { addBalance } = require("./lib/limit.js");
const { smsg, formatp, tanggal, GIFBufferToVideoBuffer, formatDate, getTime, isUrl, sleep, clockString, runtime, fetchJson, getBuffer, jsonformat, format, parseMention, getRandom, fetchBuffer } = require('./lib/myfunc')
const _ = require("lodash");
const yargs = require("yargs/yargs");
const kaitime = moment.tz('Asia/Kolkata').format('HH:mm:ss');
const kaidate = moment.tz('Asia/Kolkata').format('DD/MM/YYYY');
const time2 = moment().tz('Asia/Kolkata').format('HH:mm:ss');
const currentDate = new Date();
const options = { weekday: 'long' }; // Specify 'long' to get the full day name
const currentDay = new Intl.DateTimeFormat('en-US', options).format(currentDate);
const speed = require('performance-now');
const eco = require('discord-mongoose-economy');
const thiccysapi = require('textmaker-thiccy');
// const ffmpeg = require('fluent-ffmpeg');
// const ffmpegPath = require('ffmpeg-static').path;
// ffmpeg.setFfmpegPath(ffmpegPath);
const maker = require('mumaker');
const Jimp = require('jimp'); // for full dp etc.
const modapk = require("tod-api");
const { hentai } = require('./lib/scraper2.js');
const { instadl } = require('./lib/instadl');
const ty = eco.connect('mongodb+srv://profilecorrupted:[email protected]/?retryWrites=true&w=majority');
const { isLimit, limitAdd, getLimit, giveLimit, kurangBalance, getBalance, isGame, gameAdd, givegame, cekGLimit } = require('./lib/limit.js');
const githubstalk = require('./lib/githubstalk');
let { covid } = require('./lib/covid.js');
const { Gempa } = require("./lib/gempa.js");
const spaceemojis = ["🌌", "🌠", "🚀", "🪐", "🌟"]; // list of emojis for Space CMDs.
const os = require('os'); // for os info
const gis = require("g-i-s");
const { MessageType } = require('baileysjs');
const {
FajarNews,
BBCNews,
metroNews,
CNNNews,
iNews,
KumparanNews,
TribunNews,
DailyNews,
DetikNews,
OkezoneNews,
CNBCNews,
KompasNews,
SindoNews,
TempoNews,
IndozoneNews,
AntaraNews,
RepublikaNews,
VivaNews,
KontanNews,
MerdekaNews,
KomikuSearch,
AniPlanetSearch,
KomikFoxSearch,
KomikStationSearch,
MangakuSearch,
KiryuuSearch,
KissMangaSearch,
KlikMangaSearch,
PalingMurah,
LayarKaca21,
AminoApps,
Mangatoon,
WAModsSearch,
Emojis,
CoronaInfo,
JalanTikusMeme,
Cerpen,
Quotes,
Couples,
Darkjokes
} = require("dhn-api");
//"parse-ms": "^1.1.0",
//
if(time2 < "23:59:00"){
var nowtime = 'Good night Baby! 🌌'
}
if(time2 < "19:00:00"){
var nowtime = 'Good afternoon Baby! 🌆'
}
if(time2 < "18:00:00"){
var nowtime = 'Good afternoon Baby! 🌇'
}
if(time2 < "15:00:00"){
var nowtime = 'Good afternoon Baby! 🏞'
}
if(time2 < "11:00:00"){
var nowtime = 'Good morning Baby! 🌅'
}
if(time2 < "05:00:00"){
var nowtime = 'Good night Baby! 🏙'
}
//
const timestampe = speed();
const latensie = speed() - timestampe
var low;
try {
low = require("lowdb");
} catch (e) {
low = require("./lib/lowdb");
}
const { Low, JSONFile } = low;
const mongoDB = require("./lib/mongoDB");
global.opts = new Object(
yargs(process.argv.slice(2)).exitProcess(false).parse()
);
global.db = new Low(
/https?:\/\//.test(opts["db"] || "")
? new cloudDBAdapter(opts["db"])
: /mongodb/.test(opts["db"])
? new mongoDB(opts["db"])
: new JSONFile(`src/database.json`)
);
global.DATABASE = global.db; // Backwards Compatibility
global.loadDatabase = async function loadDatabase() {
if (global.db.READ)
return new Promise((resolve) =>
setInterval(function() {
!global.db.READ
? (clearInterval(this),
resolve(
global.db.data == null ? global.loadDatabase() : global.db.data
))
: null;
}, 1 * 1000)
);
if (global.db.data !== null) return;
global.db.READ = true;
await global.db.read();
global.db.READ = false;
global.db.data = {
users: {},
chats: {},
database: {},
game: {},
settings: {},
others: {},
sticker: {},
...(global.db.data || {}),
};
global.db.chain = _.chain(global.db.data);
};
loadDatabase();
global.db = JSON.parse(fs.readFileSync("./src/database.json"));
if (global.db)
global.db = {
sticker: {},
database: {},
game: {},
others: {},
users: {},
...(global.db || {}),
};
//
let isSleeping = false; // Move the declaration here.
let banUser = JSON.parse(fs.readFileSync('./database/banUser.json'));
let banchat = JSON.parse(fs.readFileSync('./database/banChat.json'));
let kaiaudio = JSON.parse(fs.readFileSync('./Media-Database/audio.json'));
let _limit = JSON.parse(fs.readFileSync('./storage/user/limit.json'));
let _buruan = JSON.parse(fs.readFileSync('./storage/user/bounty.json'));
let _darahOrg = JSON.parse(fs.readFileSync('./storage/user/blood.json'))
let ntnsfw = JSON.parse(fs.readFileSync('./database/nsfw.json')); //
let pendaftar = JSON.parse(fs.readFileSync('./storage/user/user.json'))
let balance = JSON.parse(fs.readFileSync('./database/balance.json'))
let ssewa = JSON.parse(fs.readFileSync('./database/sewa.json'))
let ban = JSON.parse(fs.readFileSync('./database/ban.json'))
let autosticker = JSON.parse(fs.readFileSync('./database/autosticker.json'))
const _autostick = JSON.parse(fs.readFileSync('./database/autostickpc.json'))
let limit = JSON.parse(fs.readFileSync('./database/limit.json'))
let setik = JSON.parse(fs.readFileSync('./src/sticker.json'))
let vien = JSON.parse(fs.readFileSync('./src/audio.json'))
let imagi = JSON.parse(fs.readFileSync('./src/image.json'))
let videox = JSON.parse(fs.readFileSync('./src/video.json'))
global.db = JSON.parse(fs.readFileSync('./src/database.json'))
let _sewa = require("./lib/sewa");
const sewa = JSON.parse(fs.readFileSync('./database/sewa.json'))
const time = moment.tz('Asia/Kolkata').format('DD/MM HH:mm:ss')
const ucap = moment(Date.now()).tz('Asia/Kolkata').locale('id').format('a')
var buln = ['/01/', '/02/', '/03/', '/04/', '/05/', '/06/', '/07/', '/08/', '/09/', '/10/', '/11/', '/12/'];
var myHari = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var tgel = new Date();
var hri = tgel.getDate();
var bulnh = tgel.getMonth();
var thisHari = tgel.getDay(),
thisDaye = myHari[thisHari];
var yye = tgel.getYear();
var syear = (yye < 1000) ? yye + 1900 : yye;
const jangwak = (hri + '' + buln[bulnh] + '' + syear)
const janghar = (thisDaye)
var myHari = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
var tgel = new Date();
var thisHari = tgel.getDay(),
thisDaye = myHari[thisHari];
var yye = tgel.getYear();
//
module.exports = A17 = async (A17, 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 : '')
const prefix = global.prefa
const isCmd = body.startsWith(prefix)
const notCmd = body.startsWith('')
const command = isCmd ? body.slice(1).trim().split(' ')[0].toLowerCase() : ''
const args = body.trim().split(/ +/).slice(1)
const pushname = m.pushName || "No Name"
const botNumber = await A17.decodeJid(A17.user.id)
const isCreator = [botNumber, ...global.Owner].map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').includes(m.sender)
const itsMe = m.sender == botNumber ? true : false
const text = args.join(" ")
const from = m.chat
const quoted = m.quoted ? m.quoted : m
const mime = (quoted.msg || quoted).mimetype || ''
const isMedia = /image|video|sticker|audio/.test(mime)
const messagesD = body.slice(0).trim().split(/ +/).shift().toLowerCase()
const groupMetadata = m.isGroup ? await A17.groupMetadata(m.chat).catch(e => { }) : ''
const groupName = m.isGroup ? groupMetadata.subject : ''
const participants = m.isGroup ? await groupMetadata.participants : ''
const groupAdmins = m.isGroup ? await participants.filter(v => v.admin !== null).map(v => v.id) : ''
const groupOwner = m.isGroup ? groupMetadata.owner : ''
const isBotAdmins = m.isGroup ? groupAdmins.includes(botNumber) : false
const isAdmins = m.isGroup ? groupAdmins.includes(m.sender) : false
const isUser = pendaftar.includes(m.sender)
const isBan = banUser.includes(m.sender)
const welcm = m.isGroup ? wlcm.includes(from) : false
const isBanChat = m.isGroup ? banchat.includes(from) : false
const isRakyat = isCreator || global.rkyt.map(v => v.replace(/[^0-9]/g, '') + '@s.whatsapp.net').includes(m.sender) || false
const AntiLink = m.isGroup ? ntilink.includes(from) : false
const AntiLinkYoutubeVid = m.isGroup ? ntilinkytvid.includes(from) : false
const AntiLinkYoutubeChannel = m.isGroup ? ntilinkytch.includes(from) : false
const AntiLinkInstagram = m.isGroup ? ntilinkig.includes(from) : false
const AntiLinkFacebook = m.isGroup ? ntilinkfb.includes(from) : false
const AntiLinkTiktok = m.isGroup ? ntilinktt.includes(from) : false
const AntiLinkTelegram = m.isGroup ? ntilinktg.includes(from) : false
const AntiLinkTwitter = m.isGroup ? ntilinktwt.includes(from) : false
const AntiLinkAll = m.isGroup ? ntilinkall.includes(from) : false
const antiWame = m.isGroup ? ntwame.includes(from) : false
const antiVirtex = m.isGroup ? ntvirtex.includes(from) : false
const AntiNsfw = m.isGroup ? ntnsfw.includes(from) : false
autoreadsw = true
const content = JSON.stringify(m.message)
const q = args.join(' ')
const isQuotedVideo = m.mtype === 'extendedTextMessage' && content.includes('videoMessage')
const isQuotedAudio = m.mtype === 'extendedTextMessage' && content.includes('audioMessage')
autoreadsw = true;
_sewa.expiredCheck(A17, sewa);
const reply = (teks) => {
A17.sendMessage(m.chat, { text: teks},{ quoted: m})
}
/* const reply = (teks) => {
A17.sendMessage(m.chat, { text: teks }, { quoted: m });
}; */
const sender = m.isGroup ? (m.key.participant ? m.key.participant : m.participant) : m.key.remoteJid
const senderNumber = sender.split('@')[0]
function randomNomor(angka) {
return Math.floor(Math.random() * angka) + 1;
}
if (m.message) {
addBalance(m.sender, randomNomor(574), balance);
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(m.isGroup ? pushname : "Private Chat", m.chat)
);
}
if (isCmd && !isUser) {
pendaftar.push(m.sender);
fs.writeFileSync("./storage/user/user.json", JSON.stringify(pendaftar));
}
if (global.autoreadpmngc) {
if (command) {
await A17.sendPresenceUpdate("composing", m.chat);
A17.sendReadReceipt(from, m.sender, [m.key.id]);
}
}
//
// if (global.autoReadGc) {
// if (m.isGroup) {
// A17.sendReadReceipt(m.chat, m.sender, [m.key.id]);
// }
// }
// if (global.autoReadAll) {
// if (m.chat) {
// A17.sendReadReceipt(m.chat, m.sender, [m.key.id]);
// }
// }
if (global.autoRecord) {
if (m.chat) {
A17.sendPresenceUpdate("recording", m.chat);
}
}
if (global.autoTyping) {
if (m.chat) {
A17.sendPresenceUpdate("composing", m.chat);
}
}
if (global.available) {
if (m.chat) {
A17.sendPresenceUpdate("available", m.chat);
}
}
//Dm and Groups Autoreply/Bot chat
/*
if (!isCmd && !m.isGroup){
const botreply = await axios.get(`http://api.brainshop.ai/get?bid=166512&key=5nz1Ha6nS9Zx1MfT&uid=[uid]&msg=[msg]=[${budy}]`)
txt = `${botreply.data.cnt}`
m.reply(txt)
}
*/
//
for (let anju of kaiaudio){
if (budy === anju){
result = fs.readFileSync(`./Assets/audio/${anju}.mp3`)
A17.sendMessage(m.chat, { audio: result, mimetype: 'audio/mp4', ptt: true }, { quoted: m })
}
}
//
// const hariRaya = new Date("6 1, 2022 00:00:00");
// const sekarang = new Date().getTime();
// const Selisih = hariRaya - sekarang;
// const jhari = Math.floor(Selisih / (1000 * 60 * 60 * 24));
// const jjam = Math.floor(
// (Selisih % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
// );
// const mmmenit = Math.floor((Selisih % (1000 * 60 * 60)) / (1000 * 60));
// const ddetik = Math.floor((Selisih % (1000 * 60)) / 1000);
// const ultah = `${jhari}Day ${jjam}Hour ${mmmenit}Minute ${ddetik}Second`;
// async function hitungmundur(bulan, tanggal) {
// let from = new Date(`${bulan} ${tanggal}, 2022 00:00:00`).getTime();
// let now = Date.now();
// let distance = from - now;
// let days = Math.floor(distance / (1000 * 60 * 60 * 24));
// let hours = Math.floor(
// (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
// );
// let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
// let seconds = Math.floor((distance % (1000 * 60)) / 1000);
// return (
// days +
// "Day " +
// hours +
// "Hour " +
// minutes +
// "Minute " +
// seconds +
// "Second"
// );
// }
//-----------------------------------------------------------------------------------------------------------------------------------//
//don't edit this part.
const formatTime = (seconds) => {
const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);
const secs = seconds % 60;
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
};
function updateStatus() {
const uptimeInSeconds = Math.floor(process.uptime());
const uptimeFormatted = formatTime(uptimeInSeconds);
// const status = `
// ㅤㅤ〄ㅤㅤ〘 XliconV2-MD Beta Editon〙ㅤㅤ〄ㅤㅤㅤㅤ
// ㅤㅤㅤ〘ㅤ Auto Uptime: ${uptimeFormatted}ㅤ〙`;
function _0x582b(_0xabb6f8,_0x12cdd8){const _0x58e890=_0x58e8();return _0x582b=function(_0x582b90,_0x4387b3){_0x582b90=_0x582b90-0x189;let _0x932613=_0x58e890[_0x582b90];return _0x932613;},_0x582b(_0xabb6f8,_0x12cdd8);}function _0x58e8(){const _0x109554=['12896370RDSmnX','3BgvPel','189HbmdoW','18854HvEPNh','11TZHUID','9125326EcyeIg','464328lPaAMf','3400722cbWEOK','2263175KIczdo','12TaHNqM','2521564eqJRHK'];_0x58e8=function(){return _0x109554;};return _0x58e8();}(function(_0x429d7b,_0x532ab5){const _0x527567=_0x582b,_0x130eb4=_0x429d7b();while(!![]){try{const _0x75c57a=-parseInt(_0x527567(0x18b))/0x1+-parseInt(_0x527567(0x192))/0x2*(-parseInt(_0x527567(0x189))/0x3)+parseInt(_0x527567(0x191))/0x4*(-parseInt(_0x527567(0x190))/0x5)+-parseInt(_0x527567(0x18f))/0x6+parseInt(_0x527567(0x18d))/0x7+parseInt(_0x527567(0x18e))/0x8*(-parseInt(_0x527567(0x18a))/0x9)+parseInt(_0x527567(0x193))/0xa*(parseInt(_0x527567(0x18c))/0xb);if(_0x75c57a===_0x532ab5)break;else _0x130eb4['push'](_0x130eb4['shift']());}catch(_0x19ea04){_0x130eb4['push'](_0x130eb4['shift']());}}}(_0x58e8,0xa8dae));const status='\x0a\x20\x20ㅤㅤ〄ㅤㅤ〘\x20Xlicon-V2\x20Public\x20Edition\x20〙ㅤㅤ〄ㅤㅤㅤㅤ\x0a\x20\x20ㅤㅤㅤ〘ㅤ\x20Auto\x20Uptime:\x20'+uptimeFormatted+'ㅤ〙';
A17.setStatus(status); // Set the status using A17.setStatus or your equivalent method
// Update the status randomly within 5 minutes (300000 milliseconds)
const randomTime = Math.floor(Math.random() * 300000) + 1000; // don't edit.
setTimeout(updateStatus, randomTime);
}
// Initial call to start the random status updates
updateStatus();
//-----------------------------------------------------------------------------------------------------------------------------------//
//
// if (AntiLinkAll)
// var rondonxk = '[-a-zA-Z0-9@:%._+~#=].[-a-zA-Z0-9@:%._+~#=].[-a-zA-Z0-9()@:%_+.~#?&/=]'
// if (budy.includes("https://")) {
// if (!isBotAdmins) return
// bvl = `\`\`\`「 Antilink System 」\`\`\`\n\nLink sent by Admin so no action will be taken!`
// if (isAdmins) return reply(bvl)
// if (m.key.fromMe) return reply(bvl)
// if (isCreator) return reply(bvl)
// kice = m.sender
// await A17.sendMessage(
// from,
// {
// delete: {
// remoteJid: from,
// fromMe: false,
// id: m.id,
// participant: m.sender,
// },
// },
// {
// quoted: m,
// }
// );
// // await A17.groupParticipantsUpdate(m.chat, [kice], 'remove')
// A17.sendMessage(from, { text: `\`\`\`「 Antilink System 」\`\`\`\n\n*```⚠️ Group link detected !```*\n\n*🚫@${kice.split("@")[0]} You are not allowed to send any links in this group !*\n`, contextInfo: { mentionedJid: [kice] } }, { quoted: m })
// } else {
// }
// if (budy.includes("http://")) {
// if (!isBotAdmins) return
// bvl = `\`\`\`「 Antilink System 」\`\`\`\n\nLink sent by Admin so no action will be taken!`
// if (isAdmins) return reply(bvl)
// if (m.key.fromMe) return reply(bvl)
// if (isCreator) return reply(bvl)
// kice = m.sender
// await A17.sendMessage(
// from,
// {
// delete: {
// remoteJid: from,
// fromMe: false,
// id: m.id,
// participant: m.sender,
// },
// },
// {
// quoted: m,
// }
// );
// // await A17.groupParticipantsUpdate(m.chat, [kice], 'remove')
// A17.sendMessage(from, { text: `\`\`\`「 Antilink System 」\`\`\`\n\n*```⚠️ Group link detected !```*\n\n*🚫@${kice.split("@")[0]} You are not allowed to send any links in this group !*\n`, contextInfo: { mentionedJid: [kice] } }, { quoted: m })
// } else {
// }
// const menulist = `
// Konichiwa ${pushname} dear 👋. I am ${global.BotName}, a bot developed by: Slasher to take your WhatsApp usage into next level.
// 「 System Info 」
// Speed : ${latensie.toFixed(4)} miliseconds
// Up Time : ${runtime(process.uptime())}
// Bot Name : ${global.BotName}
// Owner Name : ${global.OwnerName}
// 𝗣𝗹𝗮𝘁𝗳𝗼𝗿𝗺 : Amazon AWS
// 𝗧𝗼𝘁𝗮𝗹 𝗨𝘀𝗲𝗿 : ${Object.keys(global.db.users).length}
// 「 User Info 」
// User Level: ${levelMenu}
// User XP : ${xpMenu} \ ${reqXp}
// User Role : ${role}
// 「 User Bank 」
// User Balance : ${uangku}
// //Iron : ${getBesi(m.sender)}
// Gold : ${getEmas(m.sender)}
// Emarald : ${getEmerald(m.sender)}
// Potion : ${getPotion(m.sender)}
// Type *-menu* or press any button below to start using *${global.BotName}*
// ©️ *${global.BotName}* All Rights Reserved by: *Slasher*
// `
// const qtod = m.quoted? "true":"false"
// function pickRandom(list) {
// return list[Math.floor(list.length * Math.random())]
// }
//-------------------------------------------------------------- tictactoe ----------------------------------------------------------------//
//
this.game = this.game ? this.game : {}
let room = Object.values(this.game).find(room => room.id && room.game && room.state && room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender) && room.state == 'PLAYING')
if (room) {
let ok
let isWin = !1
let isTie = !1
let isSurrender = !1
//reply(`[DEBUG]\n${parseInt(m.text)}`)
if (!/^([1-9]|(me)?give up|surr?ender|off|skip)$/i.test(m.text)) return
isSurrender = !/^[1-9]$/.test(m.text)
if (m.sender !== room.game.currentTurn) {
if (!isSurrender) return !0
}
if (!isSurrender && 1 > (ok = room.game.turn(m.sender === room.game.playerO, parseInt(m.text) - 1))) {
reply({
'-3': 'Game Has Ended',
'-2': 'Invalid',
'-1': 'Invalid Position',
0: 'Invalid Position',
}[ok])
return !0
}
if (m.sender === room.game.winner) isWin = true
else if (room.game.board === 511) isTie = true
let arr = room.game.render().map(v => {
return {
X: '❌',
O: '⭕',
1: '1️⃣',
2: '2️⃣',
3: '3️⃣',
4: '4️⃣',
5: '5️⃣',
6: '6️⃣',
7: '7️⃣',
8: '8️⃣',
9: '9️⃣',
}[v]
})
if (isSurrender) {
room.game._currentTurn = m.sender === room.game.playerX
isWin = true
}
let winner = isSurrender ? room.game.currentTurn : room.game.winner
let str = `Room ID: ${room.id}
${arr.slice(0, 3).join('')}
${arr.slice(3, 6).join('')}
${arr.slice(6).join('')}
${isWin ? `@${winner.split('@')[0]} Won!` : isTie ? `Game Over` : `Turn ${['❌', '⭕'][1 * room.game._currentTurn]} (@${room.game.currentTurn.split('@')[0]})`}
❌: @${room.game.playerX.split('@')[0]}
⭕: @${room.game.playerO.split('@')[0]}
Typed *surrender* to surrender and admited defeat`
if ((room.game._currentTurn ^ isSurrender ? room.x : room.o) !== m.chat)
room[room.game._currentTurn ^ isSurrender ? 'x' : 'o'] = m.chat
if (room.x !== room.o) await A17.sendText(room.x, str, m, { mentions: parseMention(str) } )
await A17.sendText(room.o, str, m, { mentions: parseMention(str) } )
if (isTie || isWin) {
delete this.game[room.id]
}
}
//-----------------------------------------------------------------------------------------------------------------------------------//
//
const pickRandom = (arr) => {
return arr[Math.floor(Math.random() * arr.length)]
}
/*
let smallinput = budy.toLowerCase()
if (smallinput.includes('hello')) {
reply (`Hello ${pushname}, I am ${BotName}. How can i help you?`);
}
//if (smallinput.includes('hi')) {
// reply (`Hello ${pushname}, I am ${BotName}. How can i help you?`);
// }
if (smallinput=='slasher') {
reply (`My Boss is lost in Anime World, and I lost the connection with him...`)
}
if (smallinput=='runtime') {
reply (`Hey ${pushname} my runtime is ${runtime(process.uptime())}\n\nCurrent Time: ${kaitime}\n\nCurrent Date: ${kaidate}`)
}
if( smallinput.includes('konichiwa') || smallinput.includes('konochiwa') || smallinput.includes('konichiba') || smallinput.includes('salute')){
reply (`Konichiwa ${pushname}, I am ${BotName}. How can i help you?`);
}
if (smallinput=='xlicon') {
reply ('Yes I am Alive 🫂')
}
if (smallinput=='shinobu') {
reply ('Only you...🫶🏻')
}
if (smallinput=='ping') {
reply (`Hey ${pushname} Pong ${latensie.toFixed(4)} ms`)
}
if (smallinput.includes('good morning') || smallinput.includes('ohayo')) {
reply (`Good morning to you too ${pushname} ☺️. Have a great day 😇.`);
}
if (smallinput.includes('good afternoon') || smallinput.includes('konnichiwa')) {
reply (`Good afthernoon to you too ${pushname} ✨. Wishing you an enjoyable afternoon too 😇🤞🏻.`);
}
//if (smallinput.includes('good afthernoon')) {
// reply (`Huh ${pushname} 😇. Wishing you an enjoyable afternoon too.`);
// }
if (smallinput.includes('good night')) {
reply (`Good night to you too ${pushname} 😇. Sleep well and sweet dreams.`);
}
if (smallinput.includes('arigato')|| smallinput.includes('arigatou') || smallinput.includes('thank')) {
reply (`Mention not ${pushname} 😇. I am a bot afterall.`);
}
*/
const responses = {
hello: `Hello ${pushname}, I am ${BotName}. My current prefix is "${prefix}". How can I help you?`,
slasher: `My Boss is lost in another Multiverse, and I lost connection with him...`,
runtime: `Hey ${pushname}\n${nowtime}\n\nMy runtime:${runtime(process.uptime())}\n\nPrefix is: *${prefix}*\n\nTime: ${kaitime}\n\nDate: ${kaidate}\n\nToday is ${currentDay}`,
konichiwa: `Konichiwa ${pushname}, I am ${BotName}. How can I help you?`,
shinobu: 'Only you...🫶🏻',
ping: `Hey ${pushname}, Pong ${latensie.toFixed(4)} ms`,
'good morning': `Good morning to you too ${pushname} ☺️. Have a great day 😇.`,
ohayo: `Good morning to you too ${pushname} ☺️. Have a great day 😇.`,
'good afternoon': `Good afternoon to you too ${pushname} ✨. Wishing you an enjoyable afternoon too 😇🤞🏻.`,
konnichiwa: `Good afternoon to you too ${pushname} ✨. Wishing you an enjoyable afternoon too 😇🤞🏻.`,
'good night': `Good night to you too ${pushname} 😇. Sleep well and sweet dreams.`,
};
const smallinput = budy.toLowerCase();
if (responses.hasOwnProperty(smallinput)) {
reply(responses[smallinput]);
}
//-----------------------------------------------------------------------------------------------------------------------------------//
//
switch (command) {
//
case 'sc': case 'script': case 'sourcecode': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
A17.sendMessage(from, { react: { text: "❤" , key: m.key }})
let { data } = await axios.get('https://api.github.com/repos/ahil15/Xlicon-v2');
teks = `*XLICON Script*\n\n*Total Stars*: ${data.stargazers_count}⭐\n*Total Forks*: ${data.forks_count} forks\n*GitHub*: https://github.com/ahil15/Xlicon-v2\n\nDont forget to follow me on *GitHub* and give a ⭐️ to my projects. `
/* let buttons = [
{buttonId: `${prefix}owner`, buttonText: {displayText: '🍁 DEVELOPER 🍁'}, type: 1}
] */
let buttonMessage = {
image: Thumb,
jpegThumbnail: BotLogo ,
caption: teks,
/* footer: `${BotName}`,
buttons: buttons,
headerType: 4, */
contextInfo:{externalAdreply:{
title:"Powered by Slasher",
body: " ",
thumbnail: fs.readFileSync("Assets/pic2.jpg"),
mediaType:1,
//mediaUrl: 'https://wallpapercave.com/wp/wp10524580.jpg',
//sourceUrl: "https://wallpapercave.com/wp/wp10524580.jpg"
mediaUrl: 'github.com/ahil15/Xlicon-v2',
sourceUrl: "github.com/ahil15/Xlicon-v2"
}}
}
A17.sendMessage(m.chat, buttonMessage, { quoted: m })
}
break;
case 'support': case 'supportgc': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
A17.sendMessage(from, { react: { text: "💫" , key: m.key }})
reply(`⚙ *My developer's group:* ⚙ https://chat.whatsapp.com/EjsQvJNcFGVCSfaBEIxZm2`)
}
break;
case 'repo': case 'botrepo': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
A17.sendMessage(from, { react: { text: "💫" , key: m.key }})
reply(`⚙ My Source Code is </> - https://github.com/ahil15/Xlicon-v2`)
}
break;
case 'owner': case 'creator': case 'mod': case 'mods': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
A17.sendMessage(from, { react: { text: "💫" , key: m.key }})
A17.sendContact(m.chat, global.Owner, m)
}
break;
case 'setbotpp': {
if (!isCreator) return reply(mess.owner)
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.owner)
A17.sendMessage(from, { react: { text: "🫡" , key: m.key }})
if (!quoted) return `*Send/reply Image With Caption* ${prefix + command}`
if (!/image/.test(mime)) return `*Send/reply Image With Caption* ${prefix + command}`
if (/webp/.test(mime)) return `*Send/reply Image With Caption* ${prefix + command}`
let media = await A17.downloadAndSaveMediaMessage(quoted)
await A17.updateProfilePicture(botNumber, { url: media }).catch((err) => fs.unlinkSync(media))
m.reply(mess.jobdone)
}
break;
//
case 'changeprefix':
case 'setprefix':
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.botowner)
A17.sendMessage(from, { react: { text: "🛡️" , key: m.key }})
if (args.length !== 1) {
return m.reply(`Please provide a single character as the new prefix.`);
} else {
const newPrefix = args[0];
try {
global.prefa = [newPrefix];
return m.reply(`${pushname} Successfully changed Prefix to "${newPrefix}"`);
} catch (error) {
console.error('Error changing prefix:', error);
return m.reply(`An error occurred while changing the prefix. Please try again later.`);
}
}
//
case 'restart':
await A17.sendMessage(from, { react: { text: "⚙", key: m.key } });
if (!isCreator) return reply(mess.botowner)
await A17.sendMessage(from, { text: mess.waiting });
await A17.sendMessage(from, { react: { text: "✅", key: m.key } });
await A17.sendMessage(from, { text: 'Restarting Success!' });
// Delay the shutdown by 5 seconds using sleep function
//await sleep(5000);
// Use PM2 to restart the script
pm2.restart('index', (err) => {
if (err) {
A17.sendMessage(from, { react: { text: "❌", key: m.key } });
A17.sendMessage(from, { text: 'Restarting Failed!'});
} else {
return;
}
});
break;
//
case 'shutdown': case 'sleep':
if (!isCreator) return reply(mess.owner)
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.owner)
await A17.sendMessage(from, { react: { text: "⚠️" , key: m.key }})
reply(`Okey bye time to sleep!`)
await sleep(5000)
process.exit()
break;
case 'public': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.owner)
A17.sendMessage(from, { react: { text: "🫡" , key: m.key }})
A17.public = true
reply('Everyone can access me now')
A17.setStatus(`Mode : Public`)
}
break;
case 'self': {
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.botowner)
A17.sendMessage(from, { react: { text: "🫡" , key: m.key }})
A17.public = false
reply('Only Owner can use me now!')
A17.setStatus(`Mode : Self`)
}
break;
case 'autotyping':
case 'auto-typing':
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.botowner)
A17.sendMessage(from, { react: { text: '❤', key: m.key }});
if (args.length === 0) {
if (global.autoTyping) {
return m.reply(`Auto typing in group chats is currently *enabled*.\n\nTo disable, use \`${global.prefa[0]}autotyping off\`.`);
} else {
return m.reply(`Auto typing in group chats is currently *disabled*.\n\nTo enable, use \`${global.prefa[0]}autotyping on\`.`);
}
} else if (args.length === 1 && (args[0] === 'on' || args[0] === 'off')) {
const status = args[0];
if (status === 'on') {
global.autoTyping = true;
return m.reply(`Auto typing in group chats is now *enabled*.`);
} else {
global.autoTyping = false;
return m.reply(`Auto typing in group chats is now *disabled*.`);
}
} else {
return m.reply(`Usage: \`${global.prefa[0]}autotyping [on/off]\``);
}
break;
case 'autorecord':
case 'auto-recording':
if (isBan) return reply(mess.banned);
if (isBanChat) return reply(mess.bangc);
if (!isCreator) return reply(mess.botowner)
A17.sendMessage(from, { react: { text: '❤', key: m.key }});
if (args.length === 0) {
if (global.autoRecord) {
return m.reply(`Auto recording is currently *enabled*.\n\nTo disable, use \`${global.prefa[0]}autorecord off\`.`);
} else {
return m.reply(`Auto recording is currently *disabled*.\n\nTo enable, use \`${global.prefa[0]}autorecord on\`.`);
}
} else if (args.length === 1 && (args[0] === 'on' || args[0] === 'off')) {
const status = args[0];
if (status === 'on') {
global.autoRecord = true;
return m.reply(`Auto recording is now *enabled*.`);
} else {
global.autoRecord = false;
return m.reply(`Auto recording is now *disabled*.`);
}
} else {
return m.reply(`Usage: \`${global.prefa[0]}autorecord [on/off]\``);
}
break;
//Hosted platfrom info
case 'server':
case 'sysinfo': {
const used = process.memoryUsage();
const cpu = os.cpus()[0];
const totalCpuUsage = (100 * (cpu.times.user + cpu.times.nice + cpu.times.sys + cpu.times.irq) / cpu.times.idle).toFixed(2);
const systemName = os.platform() + ' ' + os.release();
const respon = `
🤖 *Xlicon's Server Info* 🤖
*System*: ${systemName}
*RAM*: ${formatp(os.totalmem() - os.freemem())} / ${formatp(os.totalmem())}
*NodeJS Memory Usage*: ${Object.keys(used).map(key => `${key}: ${formatp(used[key])}`).join(', ')}
*Total CPU Usage*: ${totalCpuUsage}%
*CPU Model*: ${cpu.model.trim()} (${cpu.speed} MHz)