This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1332 lines (986 loc) · 54.1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import tmi from "tmi.js";
import express from "express";
import http from "http";
import { Server } from "socket.io";
import dotenv from "dotenv";
import {top5msgs, msgsCom, LoveCom, KtoCom, MarryCom, WiekCom, ZjebCom, MogemodaCom, KamerkiCom, AODCom, OfflinetimeCom, pointsCom, PogodaCom, ChattersCom, checkBlacklistCom, fiveM} from "./commands/index.js";
import { checkTimeout, missingAll, missing, duelsWorking, getPoints, getChatters } from "./functions/requests/index.js";
import {insertToDatabase, lastSeenUpdate, getMeCooldowns, getSubsPoints, getMultipleRandom, waitforme} from "./components/index.js";
import { RollOrMark, checkFan } from "./commands/templates/index.js";
import { Truncate, onlySpaces } from "./functions/index.js";
import check_if_user_in_channel from "./functions/lewus/index.js";
import {registerDiscord, registerToBL, removeFromBL, todayBans} from "./functions/yfles/index.js";
import {oddMessage, dataFromFiles} from "./returns/index.js";
import subInsert from "./database/subInsert.js";
import SelectStreams from "./components/SelectStreams.js";
import {rollWinColor} from "./components/gamble/index.js";
import {rollDice} from "./components/dice/index.js";
import gambleUpdate from "./functions/yfles/gambleUpdate.js";
import {emojiColor, multiplyColor} from "./functions/gamble/index.js";
import {multiplyDice} from "./functions/dice/index.js";
import twitchlogger from "./commands/watchtime/twitchlogger.js";
import twitchloggerTOP3 from "./commands/top3/twitchlogger.js";
import ksiezniczki from "./commands/ksiezniczki.js";
import ileogladalkobiet from "./commands/ileogladalkobiet.js";
import watchtimeall from "./commands/watchtimeall.js";
import bmcSuby from "./requests/minecraft/bmcSuby.js";
import censorGrubamruwa from "./functions/censor/grubamruwa.js";
import detectCooldown from "./returns/detectCooldown.js";
import getPrices from "./components/tiktok/getPrices.js";
import alertName from "./components/tiktok/alertName.js";
dotenv.config()
const app = express();
const server = http.createServer(app);
const io = new Server(server, {
cors: {
origin: "https://overlay.kochamfortnite.pl"
}
});
const PORT = process.env.PORT || 3000;
const joinThem = [ 'adrian1g__', 'grubamruwa', 'xspeedyq', 'dobrycsgo', 'mrdzinold', "xmerghani", "xkaleson", "neexcsgo", "banduracartel", "sl3dziv", "xmevron", "shavskyyy", "grabyyolo", "tuszol", "1wron3k", "mejnyy" ];
//const joinThem = [ '3xanax' ];
const message_number_to_trigger_odd = 3;
const message_number_to_clear_odd = 6;
let adrian1g_keyword = null;
let adrian1g_giveaway_list = [];
let adrian1g_giveaywa_timer = 0;
let tiktokCD = 0;
let streams = {
last_update: new Date(),
streams: []
};
const client = new tmi.Client({
identity: {
username: process.env.TWITCH_USERNAME,
password: process.env.TWITCH_PASSWORD
},
channels: joinThem
});
const znaniUsers = await dataFromFiles("./channels.json");
const bad_words = await dataFromFiles("./bad_words.json");
const channels_data = await dataFromFiles("./channels_data.json");
const commands_list = await dataFromFiles("./commands.json");
const commands = commands_list.commands;
app.set('json spaces', 2);
app.use(express.json());
app.get("/", (req, res) => {
res.json(
{
message: "Bot successfully started",
build_name: process.env.npm_package_name,
version: process.env.npm_package_version,
channels: joinThem
}
);
});
app.get("/jwt/:id", (req, res) => {
if(!req.params && !req.params.id) return res.status(500).json({ status: 500, message: "channel is missing" });
if(channels_data["#"+req.params.id]){
res.status(200).json(channels_data["#"+req.params.id].watchtime_top);
}else{
res.status(404).json({status: 404, message: "channel not found" })
}
});
app.get("/streams", (req, res) => {
res.json(streams);
});
app.get("/giveaway", (req, res) => {
res.json({
keyword: `!${adrian1g_keyword}`,
data: adrian1g_giveaway_list
});
});
app.use((req, res, next) => {
res.status(404).json({
message: `Route ${req.method}:${req.url} not found`,
error: "Not Found",
statusCode: 404
})
})
io.on('connection', (socket) => {
console.log('a user connected');
socket.on('disconnect', () => {
console.log('user disconnected');
});
// socket.on('register-alert', (msg) => {
// io.emit('new-alert', {
// user_login: "adrian1g__",
// amount: "5",
// type: "coffe"
// });
// });
});
server.listen(PORT, () =>
console.log(`API Server listening on port ${PORT}`)
);
setInterval(() => {
lastSeenUpdate(joinThem)
}, 10 * 60 * 1000);
setInterval(async () => {
const getSelected = await SelectStreams();
if(getSelected === null){
return;
}
streams = getSelected;
}, 3.5 * 60 * 1000);
setTimeout(async () => {
const getSelected = await SelectStreams();
if(getSelected === null){
return;
}
streams = getSelected;
}, 1000);
client.connect();
client.on("ban", (channel, username, reason, userstate) => {
insertToDatabase("bans" , {
user: username,
channel: channel,
channel_group: "YFL",
action: 'ban'
})
});
client.on("timeout", (channel, username, reason, duration, userstate) => {
insertToDatabase("bans" , {
user: username,
channel: channel,
channel_group: "YFL",
action: 'timeout',
duration: duration
})
});
client.on("subscription", (channel, username, method, message, userstate) => {
if(["#xmerghani", "#mrdzinold", "#mork","#banduracartel"].includes(channel)) return;
const cleanChannel = channel.replaceAll("#", "");
subInsert(username.toLowerCase(), {
channel: cleanChannel,
date: new Date().toJSON().slice(0, 19).replace('T', ' '),
points: 250*getSubsPoints(method)
})
// Do your stuff.
client.say(channel, `${username.toLowerCase()}, darmowe 250 punktów dodane catJAM`);
});
client.on("resub", (channel, username, months, message, userstate, methods) => {
if(["#xmerghani", "#mrdzinold", "#mork","#banduracartel"].includes(channel)) return;
const cleanChannel = channel.replaceAll("#", "");
subInsert(username.toLowerCase(), {
channel: cleanChannel,
date: new Date().toJSON().slice(0, 19).replace('T', ' '),
points: 250*getSubsPoints(methods)
})
// Do your stuff.
client.say(channel, `${username.toLowerCase()}, darmowe 250 punktów dodane catJAM`);
});
client.on("subgift", (channel, username, streakMonths, recipient, methods, userstate) => {
if(["#xmerghani", "#mrdzinold", "#mork", "#banduracartel"].includes(channel)) return;
const cleanChannel = channel.replaceAll("#", "");
subInsert(username.toLowerCase(), {
channel: cleanChannel,
date: new Date().toJSON().slice(0, 19).replace('T', ' '),
points: 250*getSubsPoints(methods)
})
client.say(channel, `${username.toLowerCase()}, darmowe 250 punktów dodane catJAM`);
});
client.on('message', async (channel, tags, message, self) => {
if(channel === "#grubamruwa"){
const censorCheck = censorGrubamruwa(message.split(" "));
if(censorCheck === true){
return client.say(channel, `!terminate ${tags.username}`);
}
}
if(self || !message.startsWith('!')) return;
const args = message.slice(1).split(' ');
const command = args.shift().toLowerCase();
const cleanChannel = channel.replaceAll("#", "");
const argumentClean = args[0] ? (args[0].replaceAll("@", "").toLowerCase()):(null)
if(bad_words.includes(args[0]) || bad_words.includes(args[1])) return;
if(commands.opluj.aliases.includes(command)) {
if(commands.opluj.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, commands.opluj.cooldown)){
return;
}
channels_data[channel].cooldowns.last = Date.now();
const template = await RollOrMark(cleanChannel, tags.username, argumentClean, commands.opluj.messages);
client.say(channel, template);
}else if(commands.kogut.aliases.includes(command)) {
if(commands.kogut.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, commands.opluj.cooldown)){
return;
}
channels_data[channel].cooldowns.last = Date.now();
const template = await RollOrMark(cleanChannel, tags.username, argumentClean, commands.kogut.messages);
client.say(channel, template);
}else if(commands.przytul.aliases.includes(command)) {
if(commands.przytul.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, commands.opluj.cooldown)){
return;
}
channels_data[channel].cooldowns.last = Date.now();
const template = await RollOrMark(cleanChannel, tags.username, argumentClean, commands.przytul.messages);
client.say(channel, template);
}else if(commands.zaprasza.aliases.includes(command)) {
if(commands.zaprasza.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, commands.opluj.cooldown)){
return;
}
channels_data[channel].cooldowns.last = Date.now();
const template = await RollOrMark(cleanChannel, tags.username, argumentClean, commands.zaprasza.messages);
client.say(channel, template);
}else if(commands.kiss.aliases.includes(command)) {
if(commands.kiss.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, commands.opluj.cooldown)){
return;
}
channels_data[channel].cooldowns.last = Date.now();
const template = await RollOrMark(cleanChannel, tags.username, argumentClean, commands.kiss.messages);
client.say(channel, template);
}else if(commands.yfl.aliases.includes(command)) {
const COMMAND = commands.yfl;
if(COMMAND.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.longer, COMMAND.cooldown)){
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules[`${COMMAND.name}`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const template = await checkFan(cleanChannel, tags.username, argumentClean, COMMAND.messages, COMMAND.associated_channels, COMMAND.name);
client.say(channel, template);
}else if(commands.ewron.aliases.includes(command)) {
const COMMAND = commands.ewron;
if(COMMAND.disabled.includes(cleanChannel)) return;
const oddvar = channels_data[channel].odd.ewron;
if(detectCooldown(channels_data[channel].cooldowns.longer, COMMAND.cooldown)){
++channels_data[channel].odd.ewron;
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(oddvar > 0){
--channels_data[channel].odd.ewron;
}
if(channels_data[channel].modules[`${COMMAND.name}`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
if(oddvar > message_number_to_trigger_odd){
if(oddvar >= message_number_to_clear_odd){
channels_data[channel].odd.ewron = 0;
}
return client.say(channel, oddMessage(tags.username));
}
const template = await checkFan(cleanChannel, tags.username, argumentClean, COMMAND.messages, COMMAND.associated_channels, COMMAND.name);
client.say(channel, template);
}else if(commands.grendy.aliases.includes(command)) {
const COMMAND = commands.grendy;
if(COMMAND.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.longer, COMMAND.cooldown)){
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules[`${COMMAND.name}`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const template = await checkFan(cleanChannel, tags.username, argumentClean, COMMAND.messages, COMMAND.associated_channels, COMMAND.name);
client.say(channel, template);
}else if(commands.resp.aliases.includes(command)) {
const COMMAND = commands.resp;
if(COMMAND.disabled.includes(cleanChannel)) return;
if(detectCooldown(channels_data[channel].cooldowns.longer, COMMAND.cooldown)){
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules[`${COMMAND.name}`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const template = await checkFan(cleanChannel, tags.username, argumentClean, COMMAND.messages, COMMAND.associated_channels, COMMAND.name);
client.say(channel, template);
}else if(["love"].includes(command)){
if(["#grubamruwa", "#xmerghani"].includes(channel)) return;
if(detectCooldown(channels_data[channel].cooldowns.last, "classic")){
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the LoveCom function. */
const commands = await LoveCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["kto"].includes(command)){
if(detectCooldown(channels_data[channel].cooldowns.longer, "longer")){
return;
}
channels_data[channel].cooldowns.longer = Date.now();
/* Taking the message from the user and sending it to the ktoCom function. */
const commands = await KtoCom(cleanChannel, tags.username, argumentClean, znaniUsers);
client.say(channel, commands);
}else if(["ksiezniczki", "topdupeczki", "topsemp"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["ksiezniczki"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const cleanSender = tags.username.toLowerCase();
if(argumentClean){
return client.say(channel, await ksiezniczki(cleanChannel, argumentClean));
}
return client.say(channel, await ksiezniczki(cleanChannel, cleanSender));
}else if(["semp", "ileogladalkobiet"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["ileogladalkobiet"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const cleanSender = tags.username.toLowerCase();
if(argumentClean){
return client.say(channel, await ileogladalkobiet(cleanChannel, argumentClean));
}
return client.say(channel, await ileogladalkobiet(cleanChannel, cleanSender));
}else if(["watchtimeall"].includes(command)){
const oddvar = channels_data[channel].odd.watchtimeall;
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
++channels_data[channel].odd.watchtimeall;
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(oddvar > 0){
--channels_data[channel].odd.watchtimeall;
}
if(channels_data[channel].modules["watchtimeall"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
if(oddvar > message_number_to_trigger_odd){
if(oddvar >= message_number_to_clear_odd){
channels_data[channel].odd.watchtimeall = 0;
}
return client.say(channel, oddMessage(tags.username));
}
const cleanSender = tags.username.toLowerCase();
if(argumentClean){
return client.say(channel, await watchtimeall(cleanChannel, argumentClean));
}
return client.say(channel, await watchtimeall(cleanChannel, cleanSender));
}else if(["watchtime", "xayopl"].includes(command)){
if(["#xspeedyq", "#grubamruwa", "#dobrycsgo", "#mrdzinold", "#xmerghani", "#xkaleson", "#neexcsgo", "#banduracartel", "#shavskyyy"].includes(channel) && command === "watchtime") return;
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["watchtime"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const cleanSender = tags.username.toLowerCase();
//sender watchtime
if(!argumentClean){
return client.say(channel, await twitchlogger(cleanChannel, cleanSender));
}
//sender checks someone on the same channel
if(!args[1]){
return client.say(channel, await twitchlogger(cleanChannel, argumentClean));
}
return client.say(channel, await twitchlogger(cleanChannel, argumentClean, args[1]));
}else if(["gdzie", "przesladowanie", "where"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(args[0] && args[0].length > 3){
const where = await check_if_user_in_channel(args[0].replaceAll("@", "").toLowerCase());
client.say(channel, where);
}else{
const where = await check_if_user_in_channel(tags.username.toLowerCase());
client.say(channel, where);
}
}else if(["marry", "slub"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the LoveCom function. */
const commands = await MarryCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["wruc", "ilejeszcze"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(args[0] && args[0].length > 3){
const whenEnds = await checkTimeout(args[0].replaceAll("@", "").toLowerCase(), cleanChannel);
client.say(channel, whenEnds);
}else{
const whenEnds = await checkTimeout(tags.username.toLowerCase(), cleanChannel);
client.say(channel, whenEnds);
}
}else if(["missingall", "ostatnioall", "kiedyall"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["missingall"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
if(!args[0] || args[0] && args[0].length < 3) return;
if(args[0]){
const whereMissing = await missingAll(args[0].replaceAll("@", "").toLowerCase());
client.say(channel, whereMissing);
}
}else if(["wiadomosci", "messsages", "msgs"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["msgs"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const tempalte = await msgsCom(cleanChannel, tags.username, argumentClean);
client.say(channel, tempalte);
}else if(["topmsgs", "top5msgs"].includes(command)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(channels_data[channel].modules["topmsgs"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const tempalte = await top5msgs(cleanChannel, tags.username, argumentClean);
client.say(channel, tempalte);
}else if(["missing", "ostatnio", "lastseen", "kiedy"].includes(command)){
if(["#mrdzinold", "#xmerghani", "#mork", "#banduracartel"].includes(channel)) return;
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
if(args[0].length < 3) return client.say(channel, `${tags.username}, zapomniałeś/aś podać nick aok`);
if(args[0]){
const whereMissing = await missing(args[0].replaceAll("@", "").toLowerCase(), cleanChannel);
client.say(channel, whereMissing);
}
}else if(["ilemamlat", "wiek"].includes(command)){
if(["#mrdzinold"].includes(channel)) return;
const oddvar = channels_data[channel].odd.wiek;
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
++channels_data[channel].odd.wiek;
return;
}
channels_data[channel].cooldowns.last = Date.now();
if(oddvar > 0){
--channels_data[channel].odd.wiek;
}
if(channels_data[channel].modules["wiek"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
if(oddvar > message_number_to_trigger_odd){
if(oddvar >= message_number_to_clear_odd){
channels_data[channel].odd.wiek = 0;
}
return client.say(channel, oddMessage(tags.username));
}
/* Taking the message from the user and sending it to the ktoCom function. */
const commands = await WiekCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["top3", "top3watchtime"].includes(command)){
const oddvar = channels_data[channel].odd.top3;
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
++channels_data[channel].odd.top3;
return;
}
channels_data[channel].cooldowns.last = Date.now();
if(oddvar > 0){
--channels_data[channel].odd.top3;
}
if(channels_data[channel].modules["top3"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
if(oddvar > message_number_to_trigger_odd){
if(oddvar >= message_number_to_clear_odd){
channels_data[channel].odd.top3 = 0;
}
return client.say(channel, oddMessage(tags.username));
}
const cleanSender = tags.username.toLowerCase();
if(argumentClean){
return client.say(channel, await twitchloggerTOP3(cleanChannel, argumentClean));
}
return client.say(channel, await twitchloggerTOP3(cleanChannel, cleanSender))
}else if(["czyjestemzjebem"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
if(channels_data[channel].modules["czyjestemzjebem"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await ZjebCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["pogoda", "weather"].includes(command)){
if(!argumentClean || onlySpaces(argumentClean)) return;
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
if(channels_data[channel].modules["pogoda"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await PogodaCom(cleanChannel, tags.username, argumentClean);
if(commands === null) return;
client.say(channel, commands);
}else if(["mogemoda", "szansanamoda"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
if(channels_data[channel].modules["mogemoda"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await MogemodaCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["kamerki"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await KamerkiCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["timeoffline", "offlinetime", "offtime"].includes(command)){
if(["#mrdzinold", "#xmerghani", "#mork", "#banduracartel"].includes(channel)) return;
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await OfflinetimeCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["duel"].includes(command)){
if(["#mrdzinold", "#xmerghani", "#mork", "#neexcsgo", "#banduracartel"].includes(channel)) return;
if(channels_data[channel].modules["duels"] === false) return client.say(channel, `${tags.username}, pojedynki są wyłączone `);
const cleanSender = tags.username.toLowerCase();
const points = await getPoints(cleanSender, cleanChannel);
const duels = channels_data[channel].duels_list;
if(["accept", "akceptuje"].includes(argumentClean)){
/* Checking if the user has provided a second argument. */
if(!args[1]) return client.say(channel, `${cleanSender}, zapomniałeś podać osobe TPFufun `);
const cleanAgainst = args[1].replaceAll("@", "").toLowerCase();
const duel_info = duels.find(x => x.id === `${cleanAgainst}-${cleanSender}`);
/* Checking if the duel exists. */
if(!duel_info) return client.say(channel, `${cleanSender}, taki pojedynek nie istnieje :/ `);
/* Finding the index of the duel in the duels array. */
const indexOfObject = duels.findIndex(object => {
return object.id === duel_info.id;
});
const pointsSender = await getPoints(cleanSender, cleanChannel);
/* Checking if the sender has enough points to duel. */
if(duel_info.points > points && duel_info.points > pointsSender) {
duels.splice(indexOfObject, 1);
return client.say(channel, `${cleanSender}, brakuje ci punktów VoHiYo `);
}
if(duel_info.expires < new Date()){
duels.splice(indexOfObject, 1);
return client.say(channel, `${cleanSender}, pojedynek wygasł :( `);
}else{
const pointsRequester = await getPoints(duel_info.user, cleanChannel);
if(duel_info.points > pointsRequester) {
duels.splice(indexOfObject, 1);
return client.say(channel, `${duel_info.user}, nie ma już punktów VoHiYo `);
}
duels.splice(indexOfObject, 1);
const command = await duelsWorking(cleanChannel, duel_info.user, duel_info.invited, duel_info.points);
return client.say(channel, command)
}
}else if(["list", "lista"].includes(argumentClean)){
if (channels_data[channel].cooldowns.longer > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.longer = Date.now();
const makeText = Truncate(duels.map((i) => i.id).join(", "), 200);
client.say(channel, `Aktualne pojedynki: ${makeText.length === 0 ? ("Brak"):makeText}`);
}else{
if (channels_data[channel].cooldowns.duels > (Date.now() - getMeCooldowns(channel).longer)) {
return;
}
channels_data[channel].cooldowns.duels = Date.now();
/* Checking if the argument is clean. If it is not clean, it will return the client.say functione. */
if(!argumentClean || argumentClean === cleanSender) return client.say(channel, `${cleanSender}, zapomniałeś podać osobe TPFufun `);
/* Checking if the user has provided a number as the second argument. */
if(!args[1] || !Number.isInteger(Number(args[1])) || Number(args[1]) === 0 || Number.isInteger(Number(args[1])) && Number(args[1]) < 0) return client.say(channel, `${cleanSender}, zapomniałeś podać kwote :| `);
/* Checking if the user has enough points to bet. */
if(Number(args[1]) > points) return client.say(channel, `${cleanSender} nie masz tylu punktów aha`);
if(duels.some(obj => obj.id === `${cleanSender}-${argumentClean}`)) return client.say(channel, `${cleanSender} taki pojedynek już istnieje TOPILNE `);
duels.push({
id: `${cleanSender}-${argumentClean}`,
user: cleanSender,
invited: argumentClean,
points: Number(args[1]),
expires: new Date(+new Date() + 60000*2)
})
client.say(channel, `${argumentClean}, jeśli akceptujesz pojedynek na kwotę ${Number(args[1])} punktów, wpisz !duel accept ${cleanSender}`)
}
}else if(["yflpoints", "punkty", "points"].includes(command)){
if(["#mrdzinold", "#xmerghani", "#mork", "#banduracartel"].includes(channel) || ["#xspeedyq", "#neexcsgo", "#sl3dziv"].includes(channel) && command === "points") return;
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await pointsCom(cleanChannel, tags.username, argumentClean, args);
client.say(channel, commands);
}else if(["module", "modules"].includes(command)){
const badges = tags.badges || {};
const isBroadcaster = badges.broadcaster;
const isMod = badges.moderator;
const isModUp = isBroadcaster || isMod;
if(isModUp || tags.username === "3xanax"){
if(!args[0]) return client.say(channel, `${tags.username}, enable/disable `);
if(args[0] === "enable"){
if(!args[1]) return client.say(channel, `${tags.username}, zapomniałeś podać nazwę modułu `);
if(args[1] === "duels") {
channels_data[channel].duels_list = [];
}
channels_data[channel].modules[`${args[1]}`] = true;
client.say(channel, `${tags.username}, włączyłeś moduł ${args[1]}`)
}else if(args[0] === "disable"){
if(!args[1]) return client.say(channel, `${tags.username}, zapomniałeś podać nazwę modułu `);
if(args[1] === "duels") {
channels_data[channel].duels_list = [];
}
channels_data[channel].modules[`${args[1]}`] = false;
client.say(channel, `${tags.username}, wyłączyłeś moduł ${args[1]}`)
}else if(args[0] === "list"){
client.say(channel, `${tags.username}, wszystkie dostępne moduły: topmsgs, msgs, duel, mogemoda, czyjestemzjebem, top3, wiek, missingall, watchtime, watchtimeall, ileogladalkobiet, ksiezniczki, yfl, ewron, pogoda, aod, fivem `)
}else if(args[0] === "clearduels"){
channels_data[channel].duels_list = [];
client.say(channel, `${tags.username}, wyczyściłeś wszystkie duele `)
}else if(args[0] === "overlayf5"){
io.emit('refresh-overlay', "true");
client.say(channel, `${tags.username}, odświeżono overlay. `)
}
}
}else if(["giveaway", "gw"].includes(command)){
if(["#mrdzinold", "#xmerghani", "#mork", "#banduracartel"].includes(channel)) return;
const badges = tags.badges || {};
const isBroadcaster = badges.broadcaster;
const isMod = badges.moderator;
const isModUp = isBroadcaster || isMod;
if(isModUp || tags.username === "3xanax"){
if(args[0] === "one"){
const chatters = await getChatters(cleanChannel);
const rolled = getMultipleRandom(chatters, 1);
subInsert(rolled[0].name, {
channel: cleanChannel,
date: new Date().toJSON().slice(0, 19).replace('T', ' '),
points: 800
})
client.say(channel, `jasperSkupienie LOSOWANIE WYGRYWA...`);
setTimeout(() => {
client.say(channel, `Gratulacje ${rolled[0].name} wygrałeś darmowe 800 punktów BRUHBRUH FIRE `);
}, 2000);
}else if(args[0] === "multi"){
const chatters = await getChatters(cleanChannel);
if(chatters.length < 5) return client.say(channel, `${tags.username}, na kanale jest za mało osób aha`);
const rolled = getMultipleRandom(chatters, 5);
let winners = "";
client.say(channel, `jasperSkupienie LOSOWANIE WYGRYWAJA...`);
await Promise.all(
rolled.map(async (i) => {
winners += i.name + ', ';
subInsert(i.name, {
channel: cleanChannel,
date: new Date().toJSON().slice(0, 19).replace('T', ' '),
points: 160
})
})
);
setTimeout(() => {
client.say(channel, `Gratulacje ${winners} wygraliście darmowe 160 punktów BRUHBRUH FIRE `);
}, 2000);
}else{
client.say(channel, `${tags.username}, nie znany rodzaj - one/multi`);
}
}
}else if(["help", "commands", "komendy", "pomoc"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
client.say(channel, `!hug, !opluj, !ewron, !yfl, !kogut, !watchtimeall, !watchtime, !ileogladalkobiet, !ksiezniczki, !kto, !gdzie, !ilejeszcze, !missing i wiele więcej na https://yfl.es/bot ok`);
}else if(["chatters"].includes(command)){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {
return;
}
channels_data[channel].cooldowns.last = Date.now();
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await ChattersCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);
}else if(["zjeb", "blacklist"].includes(command)){
const badges = tags.badges || {};
const isBroadcaster = badges.broadcaster;
const isMod = badges.moderator;
const isVip = badges.vip;
const isModUp = isBroadcaster || isMod || isVip;
if(argumentClean === "mark" && (isModUp || tags.username === "3xanax" || tags.username === "youngkarthez")){
const argumentClean2 = args[1].replaceAll("@", "").toLowerCase();
if(argumentClean2 && argumentClean2.length > 3){
const register = await registerToBL(argumentClean2, {mark: true, registrator: tags.username});
if(register === null) return client.say(channel, `${tags.username}, nie udało się zarejestrować zjeba jasperSad `);;
client.say(channel, `${tags.username}, zarejestrowałeś ${argumentClean2}, jako zjeba aok`);
return;
}
client.say(channel, `${tags.username}, zapomniałeś podać osobe aok`);
}else if(argumentClean === "unmark" && (isModUp || tags.username === "3xanax" || tags.username === "youngkarthez")){
const argumentClean2 = args[1].replaceAll("@", "").toLowerCase();
if(argumentClean2 && argumentClean2.length > 3){
const register = await removeFromBL(argumentClean2);
if(register === null) return client.say(channel, `${tags.username}, nie udało się usunąć tytułu zjeba jasperSad `);;
client.say(channel, `${tags.username}, usunąłeś ${argumentClean2}, tytuł zjeba aok`);
return;
}
client.say(channel, `${tags.username}, zapomniałeś podać osobe aok`);
}else if(argumentClean && argumentClean.length > 3){
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {return;}
channels_data[channel].cooldowns.last = Date.now();
if(channels_data[channel].modules["zjeb"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const command = await checkBlacklistCom(argumentClean);
client.say(channel, command);
}else{
if (channels_data[channel].cooldowns.last > (Date.now() - getMeCooldowns(channel).classic)) {return;}
channels_data[channel].cooldowns.last = Date.now();
if(channels_data[channel].modules["zjeb"] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const command = await checkBlacklistCom(tags.username.toLowerCase());
client.say(channel, command);
}
}else if(["fivem", "5city", "nrp", "notrp", "cocorp", "coco"].includes(command)) {
if (channels_data[channel].cooldowns.special > (Date.now() - getMeCooldowns(channel).special)) {
return;
}
channels_data[channel].cooldowns.special = Date.now();
if(channels_data[channel].modules[`fivem`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
const template = await fiveM(cleanChannel, tags.username, argumentClean);
client.say(channel, template);
}else if(["aod"].includes(command)){
if (channels_data[channel].cooldowns.special > (Date.now() - getMeCooldowns(channel).special)) {
return;
}
channels_data[channel].cooldowns.special = Date.now();
if(channels_data[channel].modules[`aod`] === false) return client.say(channel, `${tags.username}, ${command} jest wyłączone `);
/* Taking the argumentClean variable and passing it to the EwronCom function. */
const commands = await AODCom(cleanChannel, tags.username, argumentClean);
client.say(channel, commands);