Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //تسوي الملفات ذي
- //antigreff.json
- //config.json
- //تحط بداخلها ذي القوسين {}
- let anti = JSON.parse(fs.readFileSync("./antigreff.json", "UTF8"));
- let config = JSON.parse(fs.readFileSync("./config.json", "UTF8"));
- client.on("message", message => {
- if(!message.channel.guild) return;
- let user = anti[message.guild.id+message.author.id]
- let num = message.content.split(" ").slice(1).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: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3,
- time: 30
- }
- if(message.content.startsWith(prefix + "limit")) {
- if(!message.member.hasPermission('MANAGE_GUILD')) return;
- if(message.content.startsWith(prefix + "limitbans")) {
- if(!num) return message.channel.send("**→ | Supply a number !");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].banLimit = num;
- message.channel.send(`**→ | Changed bans limit to : ${config[message.guild.id].banLimit}.**`)
- }
- if(message.content.startsWith(prefix + "limitkicks")) {
- if(!num) return message.channel.send("**→ | Supply a number !**");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].kickLimits = num;
- message.channel.send(`**→ | Changed kicks limit to : ${config[message.guild.id].kickLimits}.**`)
- }
- if(message.content.startsWith(prefix + "limitroleDelete")) {
- if(!num) return message.channel.send("**→ | Supply a number !**");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].roleDelLimit = num;
- message.channel.send(`**→ | Changed Role Deleting limit to : ${config[message.guild.id].roleDelLimit}.**`)
- }
- if(message.content.startsWith(prefix + "limitroleCreate")) {
- if(!num) return message.channel.send("**→ | Supply a number !**");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].roleCrLimits = num;
- message.channel.send(`**→ | Changed Role Creation limit to : ${config[message.guild.id].roleCrLimits}.**`)
- }
- if(message.content.startsWith(prefix + "limitchannelDelete")) {
- if(!num) return message.channel.send("**→ | Supply a number !**");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].chaDelLimit = num;
- message.channel.send(`**→ | Changed Channel Deleting limit to : ${config[message.guild.id].chaDelLimit}.**`)
- }
- if(message.content.startsWith(prefix + "limittime")) {
- if(!num) return message.channel.send("**→ | Supply a number !**");
- if(isNaN(num)) return message.channel.send("**→ | Supply a number !**");
- config[message.guild.id].time = num;
- message.channel.send(`**→ | Changed Times limit to : ${config[message.guild.id].time}.**`)
- }
- fs.writeFile("./config.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;
- });
- }
- });
- client.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: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[channel.guild.id + entry.id]) {//Zine , Mohamed Tarek , Kbosh
- 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)//Zine , Mohamed Tarek , Kbosh
- 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.get(entry.id).ban().catch(e => channel.guild.owner.send(`**→ | ${entry.username} , Deleted many __Channles__.**`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.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("./config.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;
- });
- });
- client.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: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- 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].roleDelLimit) {
- channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**→ | ${entry.username} , Deleted many __Roles__!**`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.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("./config.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;
- });
- });
- client.on("roleCreate", async channel => {
- const entry1 = await channel.guild.fetchAuditLogs({
- type: 'ROLE_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: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- 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].roleCrLimits) {
- channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**→ | ${entry.username} , is creating many __Rooms__.**`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.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("./config.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;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement