-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
1564 lines (1480 loc) · 49.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
////////////////////////////////////////////////////////////////////////////
const dreams = [
"Find and count some sheep",
"Climb a really tall mountain",
"Wash the dishes"
];
const express = require(`express`);
const app = express();
const port = process.env.PORT || 3000;
app.all(`/`, (req, res) => res.end(`ModBot`));
app.listen(port, (_, PORT) => {
console.log(`Running on port ${port}`);
});
var os = require('os');
var usedMemory = os.totalmem() - os.freemem(), totalMemory = os.totalmem();
var getpercentage = ((usedMemory / totalMemory) * 100).toFixed(2) + '%'
///////////////////////////////////////////////////////////////////////////////
const { Client, MessageEmbed } = require("discord.js");
var { Util } = require("discord.js");
const calli = new Client({ disableEveryone: true });
const canvas = require("canvas");
const Canvas = require("canvas");
const convert = require("hh-mm-ss");
const botversion = require("./package.json").version;
const moment = require("moment");
const fs = require("fs");
const util = require("util");
const gif = require("gif-search");
const ms = require("ms");
const jimp = require("jimp");
const math = require("math-expression-evaluator");
const { get } = require("snekfetch");
const guild = require("guild");
const dateFormat = require("dateformat");
var table = require("table").table;
const Discord = require("discord.js");
const cmd = require("node-cmd");
const prefix = "s!";
const cooldown = new Set();
const cdtime = 5;
///////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content === prefix + "owner") {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
let embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setImage(`https://media.discordapp.net/attachments/934343386272501812/934458511549694053/IMG_20220122_204416.jpg`)
.setDescription(`
👑 **Owner Codez **
! MG丶MGYTᵈᵉᵛ#8643
[> Discord Server](https://dsc.gg/maxgaming.yt)
[> Youtube Channel](https://www.youtube.com/channel/UC1h8NFsqM4Gsd7VkFsQxSzA)`)
.setThumbnail(`https://media.discordapp.net/attachments/934343386272501812/937782514943131668/038c3621e764a461937d43267322bfd1.jpg`)
message.channel.send({ embed });
}
});
///////////////////////////////////////////////////////////////////////////////
calli.login(process.env.TOKEN);
///////////////////////////////////////////////////////////////////////////////
const callienabled = "";
const callidisabled = "";
const callifalse = "";
const callitrue = "";
const callicolor = "";
const calliimgae = "";
const calliban = ""; const securitybots = "MG’s Security#3455";
const calliwarn = ""; const callidevelopers = "806810037459746846"; const calliowner = "806810037459746846";
///////////////////////////////////////////////////////////////////////////////
calli.on("ready", () => {
console.log(`${calli.user.tag}`);
calli.user.setActivity(`${prefix}help | dsc.gg/maxgaming.yt`, {
Type: "Playing"
});
});
///////////////////////////////////////////////////////////////////////////////
calli.on("message", async message => {
if (message.content.startsWith(prefix + "help")) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
let help = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`
**The MG Development**
Indocraft Security is an anti nuke bot with some moderation features.
**Info Commands**
\`${prefix}botinfo\`, \`${prefix}userinfo\`, \`${prefix}serverinfo\`, \`${prefix}invite\`,\`${prefix}owner\`
**Moderation Commands**
\`${prefix}lock\`, \`${prefix}unlock\`, \`${prefix}ban\`, \`${prefix}kick\`, \`${prefix}unban\`
**Security Number**
\`${prefix}anti kick\`, \`${prefix}anti ban\`, \`${prefix}anti channelD\`, \`${prefix}anti channelC\`, \`${prefix}anti roleD\`, \`${prefix}anti roleC\`
**Security On/Off**
\`${prefix}anti bot\`: on-off
**Security**
\`${prefix}settings\`
\`${prefix}punishment\`: to check current punishment type.
\`${prefix}punishment <kick|ban|remove role>\`: to change punishment type.
`);
message.channel.send(help);
}
});
///////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content === prefix + "rules") {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (message.author.id !== message.guild.ownerID)
return message.channel.send("**You must have a higher role use this command**");
let embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setImage(`callilogo`)
.setThumbnail(calli.user.avatarURL())
.setDescription(`
**General Rules
●▬▬▬▬▬▬▬▬๑۩✰۩๑▬▬▬▬▬▬▬▬●
Rule's : s
No blank nicknames.
No inappropriate nicknames.
No offensive nicknames.
No nicknames with unusual or unreadable Unicode.
No blank profile pictures.
No inappropriate profile pictures.
No sexually explicit profile pictures.
No offensive profile pictures.
No membership granted to minors (under 18 years).
Moderators reserve the right to change nicknames.
Moderators reserve the right to use their own discretion regardless of any rule.
No exploiting loopholes in the rules (please report them).
No inviting unofficial bots.
No bugs, exploits, glitches, hacks, bugs, etc.
Text chat rules
No questioning the mods.
No @mentioning the mods.
No asking to be granted roles/moderator roles.
@mention the moderators for support.
Contact the moderators under #support for support.
No @everyone/@here mentioning without permission.
No @mentioning spam.
No pornographic content.
No NSFW content.
No illegal content.
No modding.
No hacking.
No personal attacks.
No witch hunting.
No harassment.
No hate speech.
No offensive language/cursing.
No religious discussions.
No political discussions.
No flame wars.
Agree to disagree.
No trolling.
No spamming.
No excessive messaging (breaking up an idea in many posts instead of writing all out in just one post).
No walls of text (either in separate posts or as a single post).
No CAPS LOCK.
No overusing emojis.
No overusing reactions.
No external emojis.
Keep conversations in English.
Use #channel for conversations in another/other language(s).
Moderators reserve the right to delete any post.
Moderators reserve the right to edit any post.
No advertisement.
No advertisement without permission.
No links.
No linking to other servers.
No memes.
No pictures.
No gifs.
No bot commands.
Bot commands only under #bot-cmd
List of allowed bot commands:
No channel hopping.
No offtopic/use the right text channel for the topic you wish to discuss
●▬▬▬▬▬▬▬▬๑۩✰۩๑▬▬▬▬▬▬▬▬●
> Temp Mute
> Temp Kick
> Temp Ban
> Perm Ban
> Depends on your warnings**
`);
message.channel.send({ embed });
}
});
///////////////////////////////////////////////////////////////////////////////
calli.on("message", async message => {
if (message.content.startsWith(prefix + "invite")) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
let help = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`
[Click here](https://discord.com/api/oauth2/authorize?client_id=${calli.user.id}&permissions=8&scope=bot) **to invite the bot.**
[Youtube](https://www.youtube.com/channel/UC1h8NFsqM4Gsd7VkFsQxSzA) **Bot Owner.**`);
message.channel.send(help);
}
});
///////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content.startsWith(`${prefix}botinfo`)) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
const tnx = new Discord.MessageEmbed()
.setColor(`#589bff`)
.addField("Name", `${calli.user.tag}`, true)
.addField("Name", `${calli.user.tag}`, true)
.addField("ID", `${calli.user.id}`, true)
.addField("Version", `${process.version}`, true)
.addField("Guilds", `${calli.guilds.cache.size} Guilds`, true)
.addField("Users", `${calli.users.cache.size} Users`, true)
.addField(
"Ping",
`${Date.now() - message.createdTimestamp}` + "ms",
true
);
message.channel.send(tnx);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content.startsWith(prefix + "serverinfo")) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
var EMBED = new Discord.MessageEmbed()
.addField("Server Name", `${message.guild.name}`)
.addField("Server Id", `${message.guild.id}`)
.addField("Guild Owner", `${message.guild.owner}`)
.addField("Boosts", `${message.guild.premiumSubscriptionCount}`)
.addField("Channels", `${message.guild.channels.cache.size} Channels`)
.addField("Roles", `${message.guild.roles.cache.size} Roles`)
.addField("Members", `${message.guild.memberCount} Members`)
.setThumbnail(message.guild.iconURL())
.setColor(`#589bff`);
message.channel.send(EMBED);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", prof => {
if (prof.content.startsWith(prefix + "userinfo")) {
if (cooldown.has(prof.author.id)) {
return prof.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(prof.author.id);
setTimeout(() => {
cooldown.delete(prof.author.id);
}, cdtime * 1000);
var professor = new Discord.MessageEmbed()
.setThumbnail(prof.member.user.displayAvatarURL({ dynamic: true }))
.setColor(`#589bff`)
.addField("Username", `<@${prof.author.id}>`)
.addField("User Id", `${prof.author.id}`)
.addField(
"Joined Server At",
moment(prof.joinedAt).format("D/M/YYYY h:mm a"),
true
)
.addField("Create User", prof.author.createdAt.toLocaleString());
prof.channel.send(professor);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content.startsWith(prefix + "lock")) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (!message.guild.member(message.author).hasPermission("MANAGE_CHANNELS"))
return message.channel.send(
"**You must have a higher role use this command**"
);
message.channel
.createOverwrite(message.guild.id, { SEND_MESSAGES: false })
.then(() => {
const embed = new Discord.MessageEmbed()
.setDescription(
`
🔒 A channel has been locked.
Channel: <#${message.channel.id}>
Moderator: <@${message.author.id}>
**Reason**
Not-Provided
`
)
.setColor(`#589bff`);
return message.channel.send(embed);
});
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content.startsWith(prefix + "unlock")) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (!message.member.hasPermission("MANAGE_CHANNELS"))
return message.channel.send(
"**You must have a higher role use this command**"
);
message.channel
.createOverwrite(message.guild.id, { SEND_MESSAGES: true })
.then(() => {
const embed = new Discord.MessageEmbed()
.setDescription(
`
🔒 A channel has been unloked.
Channel: <#${message.channel.id}>
Moderator: <@${message.author.id}>
**Reason**
Not-Provided
`
)
.setColor(`#589bff`);
return message.channel.send(embed);
});
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content === prefix + "servers") {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (message.author.id !== message.guild.ownerID)
return message.channel.send(
"**You must have a higher role use this command**"
);
let embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.addField("Guilds", `${calli.guilds.cache.size} Guilds`, true)
.addField("Users", `${calli.guilds.cache.reduce((a, g) => a + g.memberCount, 0)} Users`, true)
.setThumbnail(message.member.user.displayAvatarURL({ dynamic: true }));
message.channel.send({ embed });
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", async message => {
if (
message.author.bot ||
!message.guild ||
!message.content.startsWith(prefix)
)
return;
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/),
commandName = args.shift().toLowerCase();
if (["ban", "kick"].includes(commandName)) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
let mode = commandName;
if (
!message.member.hasPermission(
mode == "kick" ? "KICK_MEMBERS" : "BAN_MEMBERS"
)
)
return message.channel.send(
"**You must have a higher role use this command**"
);
let user = message.guild.member(
message.mentions.users.first() ||
message.guild.members.cache.find(x => x.id == args[0])
);
if (!user) return message.channel.send("** Member not found!**");
let bot = message.guild.member(calli.user);
if (user.user.id == calli.user.id) return message.channel.send("lol no");
if (user.user.id == message.guild.owner.id)
return message.channel.send(`** You can't ${mode} the owner!**`);
if (
user.roles.highest.position >= message.member.roles.highest.position &&
message.author.id !== message.guild.ownerID
)
return message.channel.send(
`** You can't ${mode} people higher ranked than yourself!**`
);
if (user.roles.highest.position >= bot.roles.highest.position)
return message.channel.send(
`** I can't ${mode} people who are higher ranked than me!**`
);
if (!user[`${mode == "ban" ? "bann" : mode}able`])
return message.channel.send(`** Specified user is not ${mode}able.**`);
user[mode](
mode == "ban"
? { days: 7, reason: `Banned by ${message.author.tag}` }
: `Kicked by ${message.author.tag}`
)
.then(() =>
message.channel.send(
`**✅ ${message.author.tag} ${
mode == "ban" ? "banned" : mode
} from the server! ✈️**`
)
)
.catch(console.error);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
let command = message.content.split(" ")[0];
if (command == prefix + "unban") {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (!message.member.hasPermission("BAN_MEMBERS")) return;
let args = message.content
.split(" ")
.slice(1)
.join(" ");
if (args == "all") {
message.guild.fetchBans().then(zg => {
zg.forEach(JxA => {
message.guild.unban(JxA);
});
});
return message.channel.send("**🟢 Unban all members **");
}
if (!args)
return message.channel.send("**Please Type the member ID / all**");
message.guild
.unban(args)
.then(m => {
message.channel.send(`**🟢 Unban this member ${m.username}**`);
})
.catch(stry => {
message.channel.send(
`**I can't find that person \`${args}\` in ban list**`
);
});
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
let commands = message.content.split(" ");
if (commands[0] == prefix + "embed") {
if (!message.guild) return;
if (message.author.id !== message.guild.ownerID)
return message.reply("** **You must have a higher role use this command****");
if (!message.guild.member(calli.user).hasPermission("MANAGE_MESSAGES"))
return message.reply(
"**You must have a higher role use this command**"
);
var args = message.content
.split(" ")
.slice(1)
.join(" ");
if (!args) {
return message.channel.send("`Usage : " + prefix + "embed <message>`");
}
message.delete();
var embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`${args}`)
message.channel.send(embed);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("message", async message => {
if (message.content.startsWith(`<@${calli.user.id}>`)) {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
let help = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setAuthor(calli.user.username, calli.user.avatarURL())
.setThumbnail(calli.user.avatarURL())
.setFooter('Thanks for adding security, I wish you luck!')
.setDescription(`
**Hello From Security**
My Prefix is [${prefix}]
**About the bot**
aprofessional moderation & security bot that can security your server
**report a problem**
If there is, you can always join the support server by type ${prefix}support. or DM a Developer. Developers you can message include MaxGamer Offical#2617
**Extra Links**
[Support](https://discord.gg/P3xPCsGEGf) - [Invite](https://discord.com/api/oauth2/authorize?client_id=${calli.user.id}&permissions=8&scope=bot)`);
message.channel.send(help);
}
});
//////////////////////////////////////////////////////////////////////////////
calli.on("guildCreate", guild => {
let embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`Thanks for adding security, I wish you luck!MADE BY MaxGamer Offical`);
guild.owner.send(embed);
});
///////////////////////////////////////////////////////////////////////////////
calli.on("message", message => {
if (message.content === prefix + "anti") {
if (cooldown.has(message.author.id)) {
return message.channel.send(`You have to wait 5 seconds`).then(m => {
m.delete({ timeout: cdtime * 600 });
});
}
cooldown.add(message.author.id);
setTimeout(() => {
cooldown.delete(message.author.id);
}, cdtime * 1000);
if (message.author.id !== message.guild.ownerID)
return message.channel.send(
"**You must have a higher role use this command**"
);
let embed = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`
**Security Number**
\`${prefix}anti kick\`: **Number**
\`${prefix}anti ban\`: **Number**
\`${prefix}anti channelD\`: **Number**
\`${prefix}anti channelC\`: **Number**
\`${prefix}anti roleD\`: **Number**
\`${prefix}anti roleC\`: **Number**
**Security On/Off**
\`${prefix}anti bot\`: **on-off**
**Security**
\`${prefix}settings\`
`)
.setThumbnail(message.member.user.displayAvatarURL({ dynamic: true }));
message.channel.send({ embed });
}
});
///////////////////////////////////////////////////////////////////////////////
let anti = JSON.parse(fs.readFileSync("./antigreff.json", "UTF8"));
let config = JSON.parse(fs.readFileSync("./configg.json", "UTF8"));
calli.on("message", message => {
if (!message.channel.guild) return;
let user = anti[message.guild.id + message.author.id];
let num = message.content
.split(" ")
.slice(2)
.join(" ");
if (!anti[message.guild.id + message.author.id])
anti[message.guild.id + message.author.id] = {
actions: 0
};
if (!config[message.guild.id])
config[message.guild.id] = {
banLimit: 1,
chaDelLimit: 1,
roleDelLimit: 1,
kickLimits: 1,
chaCrLimit: 1,
roleCrLimits: 1,
time: 0.1
};
if (message.content.startsWith(prefix + "anti")) {
if (message.author.id !== message.guild.ownerID) {
let anti = new Discord.MessageEmbed()
.setDescription("You must have a higher role use this command")
.setColor(`#589bff`);
return message.channel.send(anti);
}
{
let typeanum = new Discord.MessageEmbed()
.setDescription("type a number")
.setColor(`#589bff`);
{
let onlyanum = new Discord.MessageEmbed()
.setDescription("type a number")
.setColor(`#589bff`);
///////
if (message.content.startsWith(prefix + "anti ban")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].banLimit = num;
{
let ban = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(
`
Anti Ban has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].banLimit} ${calliwarn}
Punish at: ${config[message.guild.id].banLimit} ${calliban}
`
);
message.channel.send(ban);
}
}
if (message.content.startsWith(prefix + "anti kick")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].kickLimits = num;
{
let ban = new Discord.MessageEmbed().setColor(`#589bff`)
.setDescription(`
Anti Kick has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].kickLimits} ${calliwarn}
Punish at: ${config[message.guild.id].kickLimits} ${calliban}
`);
message.channel.send(ban);
}
}
if (message.content.startsWith(prefix + "anti roleD")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].roleDelLimit = num;
{
let roled = new Discord.MessageEmbed().setColor(`#589bff`)
.setDescription(`
Anti Role-Delete has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].roleDelLimit} ${calliwarn}
Punish at: ${config[message.guild.id].roleDelLimit} ${calliban} `);
message.channel.send(roled);
}
}
if (message.content.startsWith(prefix + "anti roleC")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].roleCrLimits = num;
{
let rolec = new Discord.MessageEmbed().setColor(`#589bff`)
.setDescription(`
Anti Role-Create has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].roleCrLimits} ${calliwarn}
Punish at: ${config[message.guild.id].roleCrLimits} ${calliban} `);
message.channel.send(rolec);
}
}
if (message.content.startsWith(prefix + "anti channelD")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].chaDelLimit = num;
{
let ban = new Discord.MessageEmbed().setColor(`#589bff`)
.setDescription(`
Anti Channel-Delete has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].chaDelLimit} ${calliwarn}
Punish at: ${config[message.guild.id].chaDelLimit} ${calliban} `);
message.channel.send(ban);
}
}
if (message.content.startsWith(prefix + "anti channelC")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].chaCrLimit = num;
{
let ban = new Discord.MessageEmbed().setColor(`#589bff`)
.setDescription(`
Anti Channel-Create has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].chaCrLimit} ${calliwarn}
Punish at: ${config[message.guild.id].chaCrLimit} ${calliban} `);
message.channel.send(ban);
}
}
if (message.content.startsWith(prefix + "anti time")) {
if (!num) return message.channel.send(typeanum);
if (isNaN(num)) return message.channel.send(onlyanum);
config[message.guild.id].time = num;
{
let ban = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setDescription(`
Anti Time has been updated
Enabled: ${callienabled}
Warn at: ${config[message.guild.id].time} ${calliwarn}
Punish at: ${config[message.guild.id].time} ${calliban} `
);
message.channel.send(ban);
}
}
fs.writeFile(
"./configg.json",
JSON.stringify(config, null, 2),
function(e) {
if (e) throw e;
}
);
fs.writeFile(
"./antigreff.json",
JSON.stringify(anti, null, 2),
function(e) {
if (e) throw e;
}
);
}
}
}
});
calli.on("channelCreate", async channel => {
const entry1 = await channel.guild
.fetchAuditLogs({
type: "CHANNEL_CREATE"
})
.then(audit => audit.entries.first());
console.log(entry1.executor.username);
const entry = entry1.executor;
if (!config[channel.guild.id])
config[channel.guild.id] = {
banLimit: 1,
chaDelLimit: 1,
roleDelLimit: 1,
kickLimits: 1,
chaCrLimit: 1,
roleCrLimits: 1
};
if (!anti[channel.guild.id + entry.id]) {
anti[channel.guild.id + entry.id] = {
actions: 1
};
setTimeout(() => {
anti[channel.guild.id + entry.id].actions = "0";
}, config[channel.guild.id].time * 1000);
} else {
anti[channel.guild.id + entry.id].actions = Math.floor(
anti[channel.guild.id + entry.id].actions + 1
);
console.log("TETS");
setTimeout(() => {
anti[channel.guild.id + entry.id].actions = "0";
}, config[channel.guild.id].time * 1000);
if (
anti[channel.guild.id + entry.id].actions >=
config[channel.guild.id].chaCrLimit
) {
channel.guild.members.cache
.get(entry.id)
.ban()
.catch(e => {
let warncrchan = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setFooter(`security`).setDescription(`
<:crowne:866155257225674752> **The Absxoxot Development**
**User Punished** ${calliban} <:Punished:867002789413519392>
<:Security:867002790077661234>have punished a user, details:
**Server:**
${channel.guild.name}
**User:**
${entry.username}
**Action**
channel-create Members
`);
channel.guild.owner.send(warncrchan);
});
anti[channel.guild.id + entry.id].actions = "0";
fs.writeFile("./configg.json", JSON.stringify(config, null, 2), function(
e
) {
if (e) throw e;
});
fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function(
e
) {
if (e) throw e;
});
}
}
fs.writeFile("./configg.json", JSON.stringify(config, null, 2), function(e) {
if (e) throw e;
});
fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function(e) {
if (e) throw e;
});
});
calli.on("channelDelete", async channel => {
const entry1 = await channel.guild
.fetchAuditLogs({
type: "CHANNEL_DELETE"
})
.then(audit => audit.entries.first());
console.log(entry1.executor.username);
const entry = entry1.executor;
if (!config[channel.guild.id])
config[channel.guild.id] = {
banLimit: 1,
chaDelLimit: 1,
roleDelLimit: 1,
kickLimits: 1,
chaCrLimit: 1,
roleCrLimits: 1
};
if (!anti[channel.guild.id + entry.id]) {
anti[channel.guild.id + entry.id] = {
actions: 1
};
setTimeout(() => {
anti[channel.guild.id + entry.id].actions = "0";
}, config[channel.guild.id].time * 1000);
} else {
anti[channel.guild.id + entry.id].actions = Math.floor(
anti[channel.guild.id + entry.id].actions + 1
);
console.log("TETS");
setTimeout(() => {
anti[channel.guild.id + entry.id].actions = "0";
}, config[channel.guild.id].time * 1000);
if (
anti[channel.guild.id + entry.id].actions >=
config[channel.guild.id].chaDelLimit
) {
channel.guild.members.cache
.get(entry.id)
.ban()
.catch(e => {
let warndelchan = new Discord.MessageEmbed()
.setColor(`#589bff`)
.setFooter(`security`).setDescription(`
**User Punished** ${calliban}
have punished a user, details:
**Server:**
${channel.guild.name}
**User:**
${entry.username}
**Action**
channel-delete Members
`);
channel.guild.owner.send(warndelchan);
});
anti[channel.guild.id + entry.id].actions = "0";
fs.writeFile("./configg.json", JSON.stringify(config, null, 2), function(
e
) {
if (e) throw e;
});
fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function(
e
) {
if (e) throw e;
});
}
}
fs.writeFile("./configg.json", JSON.stringify(config, null, 2), function(e) {
if (e) throw e;
});
fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function(e) {
if (e) throw e;
});
});
calli.on("roleDelete", async channel => {
const entry1 = await channel.guild
.fetchAuditLogs({
type: "ROLE_DELETE"
})
.then(audit => audit.entries.first());
console.log(entry1.executor.username);
const entry = entry1.executor;
if (!config[channel.guild.id])
config[channel.guild.id] = {
banLimit: 1,
chaDelLimit: 1,
roleDelLimit: 1,
kickLimits: 1,
chaCrLimit: 1,
roleCrLimits: 1
};
if (!anti[channel.guild.id + entry.id]) {
anti[channel.guild.id + entry.id] = {
actions: 1
};
setTimeout(() => {
anti[channel.guild.id + entry.id].actions = "0";
}, config[channel.guild.id].time * 1000);
} else {
anti[channel.guild.id + entry.id].actions = Math.floor(
anti[channel.guild.id + entry.id].actions + 1