Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('message', message => {
- if (message.author.bot) return;
- if (!message.guild) return;
- if (message.content.startsWith(prefix + 'config')) {
- var mrx = new Discord.RichEmbed()
- .setTitle(`**__${message.guild.name}__ , Server Settings**`)
- .addField('Ban Limit Info', `
- **• | Count : __\`${config[message.guild.id].banLimit} \`__**
- `)
- .addField('Kick Limit Info', `
- **• | Count : __\`${config[message.guild.id].kickLimits} \`__**
- `)
- .addField('Role Delete Limit Info', `
- **• | Count : __\`${config[message.guild.id].roleDelLimit} \`__**
- `)
- .addField('Role Create Limit Info', `
- **• | Count : __\`${config[message.guild.id].roleCrLimits} \`__**
- `)
- .addField('Channel Delete Limit Info', `
- **• | Count : __\`${config[message.guild.id].chaDelLimit} \`__**
- `)
- //.setFooter(message.author.avatarURL, message.author.tag)
- message.channel.sendEmbed(mrx);
- }
- });
- 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(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: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3,
- time: 30
- }
- if (message.content.startsWith(prefix + "settings limits")) {
- if (!message.member.hasPermission('MANAGE_GUILD')) return;
- if (message.content.startsWith(prefix + "settings limitsban")) {
- if (!num) return message.channel.send("**⇏ | Type Number**");
- if (isNaN(num)) return message.channel.send("**⇏ | Number Only**");
- config[message.guild.id].banLimit = num;
- message.channel.send(`**⇏ | Done It's Now : ${config[message.guild.id].banLimit} **`)
- }
- if (message.content.startsWith(prefix + "settings limitskick")) {
- if (!num) return message.channel.send("**⇏ | Type Number**");
- if (isNaN(num)) return message.channel.send("**⇏ | Numbers Only **");
- config[message.guild.id].kickLimits = num;
- message.channel.send(`**⇏ | Done It's Now : ${config[message.guild.id].kickLimits}**`)
- }
- if (message.content.startsWith(prefix + "settings limitsroleD")) {
- if (!num) return message.channel.send("**⇏ | Type Number**");
- if (isNaN(num)) return message.channel.send("**Numbers Only**");
- config[message.guild.id].roleDelLimit = num;
- message.channel.send(`**⇏ | Done It's Now : ${config[message.guild.id].roleDelLimit}**`)
- }
- if (message.content.startsWith(prefix + "settings limitsroleC")) {
- if (!num) return message.channel.send("**⇏ | Type Number**");
- if (isNaN(num)) return message.channel.send("**⇏ | Numbers Only**");
- config[message.guild.id].roleCrLimits = num;
- message.channel.send(`**⇏ | Done It's Now : ${config[message.guild.id].roleCrLimits}**`)
- }
- if (message.content.startsWith(prefix + "settings limitschannelD")) {
- if (!num) return message.channel.send("**⇏ | Type Number **");
- if (isNaN(num)) return message.channel.send("**⇏ | Numbers Only **");
- config[message.guild.id].chaDelLimit = num;
- message.channel.send(`**⇏ | Done It's Now : ${config[message.guild.id].chaDelLimit}**`)
- }
- if (message.content.startsWith(prefix + "settings limitstime")) {
- if (!num) return message.channel.send("**⇏ | Type Number **");
- if (isNaN(num)) return message.channel.send("**⇏ | Numbers Only**");
- config[message.guild.id].time = num;
- message.channel.send(`**⇏ | Done It's Now : ${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]) {
- 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.get(entry.id).ban().catch(e => channel.guild.owner.send(`**⇏ | ${entry.username} He Tried To Delete Many Channels**`))
- 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} He Tried To Delete 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} He Tried To Make 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("guildBanAdd", async (guild, user) => {
- const entry1 = await guild.guild.fetchAuditLogs({
- type: 'MEMBER_BAN_ADD'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[guild.id]) config[guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[guild.id + entry.id]) {
- anti[guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- } else {
- anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
- user.members.get(entry.id).ban().catch(e => user.owner.send(`**⇏ | ${entry.username} He Tried To Ban Many People**`))
- anti[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("guildKickAdd", async (guild, user) => {
- const entry1 = await guild.fetchAuditLogs({
- type: 'MEMBER_KICK'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[guild.id]) config[guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[guild.id + entry.id]) {
- anti[guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- } else {
- anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
- user.members.get(entry.id).ban().catch(e => user.owner.send(`**⇏ | ${entry.username} He Tried To Kick Many People**`))
- anti[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("guildMemberRemove", async member => {
- const entry1 = await member.guild.fetchAuditLogs().then(audit => audit.entries.first())
- if (entry1.action === "MEMBER_KICK") {
- const entry2 = await member.guild.fetchAuditLogs({
- type: "MEMBER_KICK"
- }).then(audit => audit.entries.first())
- const entry = entry2.executor;
- if (!config[member.guild.id]) config[member.guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[member.guild.id + entry.id]) {
- anti[member.guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[member.guild.id + entry.id].actions = "0"
- }, config[member.guild.id].time * 1000)
- } else {
- anti[member.guild.id + entry.id].actions = Math.floor(anti[member.guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[member.guild.id + entry.id].actions = "0"
- }, config[member.guild.id].time * 1000)
- if (anti[member.guild.id + entry.id].actions >= config[member.guild.id].kickLimits) {
- member.members.get(entry.id).ban().catch(e => member.owner.send(`**⇏ | ${entry.username} He Tried To Ban Many People**`))
- anti[member.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