Advertisement
MoJRemGames

protect by MoJRemGames

Nov 16th, 2019
1,217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const http = require('http');
  2. const express = require('express');
  3. const app = express();
  4. app.get("/", (request, response) => {
  5.   response.sendStatus(200);
  6. });
  7. app.listen(process.env.PORT);
  8. setInterval(() => {
  9.   http.get(`http://NameProject.glitch.me/`);
  10. }, 280000);
  11.  
  12. // كل البكجات الي ممكن تحتجها في اي بوت
  13. const { Client, RichEmbed } = require("discord.js");
  14. var { Util } = require('discord.js');
  15. const {TOKEN, YT_API_KEY, prefix, devs} = require('./config')
  16. const client = new Client({ disableEveryone: true})
  17. const ytdl = require("ytdl-core");
  18. const canvas = require("canvas");
  19. const Canvas = require("canvas");
  20. const convert = require("hh-mm-ss")
  21. const fetchVideoInfo = require("youtube-info");
  22. const botversion = require('./package.json').version;
  23. const simpleytapi = require('simple-youtube-api')
  24. const moment = require("moment");
  25. const fs = require('fs');
  26. const util = require("util")
  27. const gif = require("gif-search");
  28. const opus = require("node-opus");
  29. const ms = require("ms");
  30. const jimp = require("jimp");
  31. const { get } = require('snekfetch');
  32. const guild = require('guild');
  33. const dateFormat = require('dateformat');//npm i dateformat
  34. const YouTube = require('simple-youtube-api');
  35. const youtube = new YouTube('AIzaSyAdORXg7UZUo7sePv97JyoDqtQVi3Ll0b8');
  36. const hastebins = require('hastebin-gen');
  37. const getYoutubeID = require('get-youtube-id');
  38. const yt_api_key = "AIzaSyDeoIH0u1e72AtfpwSKKOSy3IPp2UHzqi4";
  39. const pretty = require("pretty-ms");
  40. client.login(TOKEN);
  41. const queue = new Map();
  42. var table = require('table').table
  43. const Discord = require('discord.js');
  44. client.on('ready', () => {
  45.   console.log(`Iam Ready My Owner ${client.user.tag}!`);
  46. });
  47. /////
  48.  
  49. let anti = JSON.parse(fs.readFileSync("./antigreff.json", "UTF8"));
  50. let config = JSON.parse(fs.readFileSync("./config.json", "UTF8"));
  51. client.on("message", message => {
  52.     if (!message.channel.guild) return;
  53.     let user = anti[message.guild.id + message.author.id]
  54.     let num = message.content.split(" ").slice(2).join(" ");
  55.     if (!anti[message.guild.id + message.author.id]) anti[message.guild.id + message.author.id] = {
  56.         actions: 0
  57.     }
  58.     if (!config[message.guild.id]) config[message.guild.id] = {
  59.         banLimit: 3,
  60.         chaDelLimit: 3,
  61.         roleDelLimit: 3,
  62.         kickLimits: 3,
  63.         roleCrLimits: 3,
  64.         time: 30
  65.     }
  66.     if (message.content.startsWith(prefix + "settings limits")) {
  67.  
  68.  
  69.         if (!message.member.hasPermission('MANAGE_GUILD')) return;
  70.         if (message.content.startsWith(prefix + "settings limitsban")) {
  71.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  72.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  73.             config[message.guild.id].banLimit = num;
  74.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].banLimit} **`)
  75.         }
  76.         if (message.content.startsWith(prefix + "settings limitskick")) {
  77.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  78.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  79.             config[message.guild.id].kickLimits = num;
  80.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].kickLimits}**`)
  81.         }
  82.         if (message.content.startsWith(prefix + "settings limitsroleD")) {
  83.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  84.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  85.             config[message.guild.id].roleDelLimit = num;
  86.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].roleDelLimit}**`)
  87.         }
  88.         if (message.content.startsWith(prefix + "settings limitsroleC")) {
  89.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  90.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  91.             config[message.guild.id].roleCrLimits = num;
  92.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].roleCrLimits}**`)
  93.         }
  94.         if (message.content.startsWith(prefix + "settings limitschannelD")) {
  95.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  96.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  97.             config[message.guild.id].chaDelLimit = num;
  98.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].chaDelLimit}**`)
  99.         }
  100.         if (message.content.startsWith(prefix + "settings limitstime")) {
  101.             if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
  102.             if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
  103.             config[message.guild.id].time = num;
  104.             message.channel.send(`**| تم التغيير اِلي : ${config[message.guild.id].time}**`)
  105.         }
  106.         fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  107.             if (e) throw e;
  108.         });
  109.         fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  110.             if (e) throw e;
  111.         });
  112.     }
  113. });
  114. client.on("channelDelete", async channel => {
  115.     const entry1 = await channel.guild.fetchAuditLogs({
  116.         type: 'CHANNEL_DELETE'
  117.     }).then(audit => audit.entries.first())
  118.     console.log(entry1.executor.username)
  119.     const entry = entry1.executor
  120.     if (!config[channel.guild.id]) config[channel.guild.id] = {
  121.         banLimit: 3,
  122.         chaDelLimit: 3,
  123.         roleDelLimit: 3,
  124.         kickLimits: 3,
  125.         roleCrLimits: 3
  126.     }
  127.     if (!anti[channel.guild.id + entry.id]) {
  128.         anti[channel.guild.id + entry.id] = {
  129.             actions: 1
  130.         }
  131.         setTimeout(() => {
  132.             anti[channel.guild.id + entry.id].actions = "0"
  133.         }, config[channel.guild.id].time * 1000)
  134.     } else {
  135.         anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
  136.         console.log("TETS");
  137.         setTimeout(() => {
  138.             anti[channel.guild.id + entry.id].actions = "0"
  139.         }, config[channel.guild.id].time * 1000)
  140.         if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].chaDelLimit) {
  141.             channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**| ${entry.username} قام بمسح الكثير من الرومات **`))
  142.             anti[channel.guild.id + entry.id].actions = "0"
  143.             fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  144.                 if (e) throw e;
  145.             });
  146.             fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  147.                 if (e) throw e;
  148.             });
  149.         }
  150.     }
  151.  
  152.     fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  153.         if (e) throw e;
  154.     });
  155.     fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  156.         if (e) throw e;
  157.     });
  158. });
  159.  
  160. client.on("roleDelete", async channel => {
  161.     const entry1 = await channel.guild.fetchAuditLogs({
  162.         type: 'ROLE_DELETE'
  163.     }).then(audit => audit.entries.first())
  164.     console.log(entry1.executor.username)
  165.     const entry = entry1.executor
  166.     if (!config[channel.guild.id]) config[channel.guild.id] = {
  167.         banLimit: 3,
  168.         chaDelLimit: 3,
  169.         roleDelLimit: 3,
  170.         kickLimits: 3,
  171.         roleCrLimits: 3
  172.     }
  173.     if (!anti[channel.guild.id + entry.id]) {
  174.         anti[channel.guild.id + entry.id] = {
  175.             actions: 1
  176.         }
  177.         setTimeout(() => {
  178.             anti[channel.guild.id + entry.id].actions = "0"
  179.         }, config[channel.guild.id].time * 1000)
  180.     } else {
  181.         anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
  182.         console.log("TETS");
  183.         setTimeout(() => {
  184.             anti[channel.guild.id + entry.id].actions = "0"
  185.         }, config[channel.guild.id].time * 1000)
  186.         if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].roleDelLimit) {
  187.             channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**| ${entry.username} قام بمسح الكثير من الرتب **`))
  188.             anti[channel.guild.id + entry.id].actions = "0"
  189.             fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  190.                 if (e) throw e;
  191.             });
  192.             fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  193.                 if (e) throw e;
  194.             });
  195.         }
  196.     }
  197.  
  198.     fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  199.         if (e) throw e;
  200.     });
  201.     fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  202.         if (e) throw e;
  203.     });
  204. });
  205.  
  206. client.on("roleCreate", async channel => {
  207.     const entry1 = await channel.guild.fetchAuditLogs({
  208.         type: 'ROLE_CREATE'
  209.     }).then(audit => audit.entries.first())
  210.     console.log(entry1.executor.username)
  211.     const entry = entry1.executor
  212.     if (!config[channel.guild.id]) config[channel.guild.id] = {
  213.         banLimit: 3,
  214.         chaDelLimit: 3,
  215.         roleDelLimit: 3,
  216.         kickLimits: 3,
  217.         roleCrLimits: 3
  218.     }
  219.     if (!anti[channel.guild.id + entry.id]) {
  220.         anti[channel.guild.id + entry.id] = {
  221.             actions: 1
  222.         }
  223.         setTimeout(() => {
  224.             anti[channel.guild.id + entry.id].actions = "0"
  225.         }, config[channel.guild.id].time * 1000)
  226.     } else {
  227.         anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
  228.         console.log("TETS");
  229.         setTimeout(() => {
  230.             anti[channel.guild.id + entry.id].actions = "0"
  231.         }, config[channel.guild.id].time * 1000)
  232.         if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].roleCrLimits) {
  233.             channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**| ${entry.username} قام بأنشاء الكثير من الرتب **`))
  234.             anti[channel.guild.id + entry.id].actions = "0"
  235.             fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  236.                 if (e) throw e;
  237.             });
  238.             fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  239.                 if (e) throw e;
  240.             });
  241.         }
  242.     }
  243.  
  244.     fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  245.         if (e) throw e;
  246.     });
  247.     fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  248.         if (e) throw e;
  249.     });
  250. });
  251.  
  252. client.on("guildBanAdd", async (guild, user) => {
  253.     const entry1 = await channel.guild.fetchAuditLogs({
  254.         type: 'MEMBER_BAN_ADD'
  255.     }).then(audit => audit.entries.first())
  256.     console.log(entry1.executor.username)
  257.     const entry = entry1.executor
  258.     if (!config[guild.id]) config[guild.id] = {
  259.         banLimit: 3,
  260.         chaDelLimit: 3,
  261.         roleDelLimit: 3,
  262.         kickLimits: 3,
  263.         roleCrLimits: 3
  264.     }
  265.     if (!anti[guild.id + entry.id]) {
  266.         anti[guild.id + entry.id] = {
  267.             actions: 1
  268.         }
  269.         setTimeout(() => {
  270.             anti[guild.id + entry.id].actions = "0"
  271.         }, config[guild.id].time * 1000)
  272.     } else {
  273.         anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
  274.         console.log("TETS");
  275.         setTimeout(() => {
  276.             anti[guild.id + entry.id].actions = "0"
  277.         }, config[guild.id].time * 1000)
  278.         if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
  279.             channel.members.get(entry.id).ban().catch(e => channel.owner.send(`**| ${entry.username} حاول حظر جميع الأعضاء **`))
  280.             anti[guild.id + entry.id].actions = "0"
  281.             fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  282.                 if (e) throw e;
  283.             });
  284.             fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  285.                 if (e) throw e;
  286.             });
  287.         }
  288.     }
  289.  
  290.     fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  291.         if (e) throw e;
  292.     });
  293.     fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  294.         if (e) throw e;
  295.     });
  296. });
  297.  
  298. client.on("guildKickAdd", async (guild, user) => {
  299.     const entry1 = await channel.fetchAuditLogs({
  300.         type: 'MEMBER_KICK'
  301.     }).then(audit => audit.entries.first())
  302.     console.log(entry1.executor.username)
  303.     const entry = entry1.executor
  304.     if (!config[guild.id]) config[guild.id] = {
  305.         banLimit: 3,
  306.         chaDelLimit: 3,
  307.         roleDelLimit: 3,
  308.         kickLimits: 3,
  309.         roleCrLimits: 3
  310.     }
  311.     if (!anti[guild.id + entry.id]) {
  312.         anti[guild.id + entry.id] = {
  313.             actions: 1
  314.         }
  315.         setTimeout(() => {
  316.             anti[guild.id + entry.id].actions = "0"
  317.         }, config[guild.id].time * 1000)
  318.     } else {
  319.         anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
  320.         console.log("TETS");
  321.         setTimeout(() => {
  322.             anti[guild.id + entry.id].actions = "0"
  323.         }, config[guild.id].time * 1000)
  324.         if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
  325.             channel.members.get(entry.id).ban().catch(e => channel.owner.send(`**| ${entry.username} حاول حظر جميع الأعضاء **`))
  326.             anti[guild.id + entry.id].actions = "0"
  327.             fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  328.                 if (e) throw e;
  329.             });
  330.             fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  331.                 if (e) throw e;
  332.             });
  333.         }
  334.     }
  335.  
  336.     fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  337.         if (e) throw e;
  338.     });
  339.     fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  340.         if (e) throw e;
  341.     });
  342. });
  343.  
  344. client.on("guildMemberRemove", async member => {
  345.     const entry1 = await member.guild.fetchAuditLogs().then(audit => audit.entries.first())
  346.     if (entry1.action === "MEMBER_KICK") {
  347.         const entry2 = await member.guild.fetchAuditLogs({
  348.             type: "MEMBER_KICK"
  349.         }).then(audit => audit.entries.first())
  350.         const entry = entry2.executor;
  351.         if (!config[member.guild.id]) config[guild.id] = {
  352.             banLimit: 3,
  353.             chaDelLimit: 3,
  354.             roleDelLimit: 3,
  355.             kickLimits: 3,
  356.             roleCrLimits: 3
  357.         }
  358.         if (!anti[member.guild.id + entry.id]) {
  359.             anti[member.guild.id + entry.id] = {
  360.                 actions: 1
  361.             }
  362.             setTimeout(() => {
  363.                 anti[member.guild.id + entry.id].actions = "0"
  364.             }, config[member.guild.id].time * 1000)
  365.         } else {
  366.             anti[member.guild.id + entry.id].actions = Math.floor(anti[member.guild.id + entry.id].actions + 1)
  367.             console.log("TETS");
  368.             setTimeout(() => {
  369.                 anti[member.guild.id + entry.id].actions = "0"
  370.             }, config[member.guild.id].time * 1000)
  371.             if (anti[member.guild.id + entry.id].actions >= config[member.guild.id].kickLimits) {
  372.                 member.members.get(entry.id).ban().catch(e => member.owner.send(`**| ${entry.username} حاول حظر جميع الأعضاء **`))
  373.                 anti[member.guild.id + entry.id].actions = "0"
  374.                 fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  375.                     if (e) throw e;
  376.                 });
  377.                 fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  378.                     if (e) throw e;
  379.                 });
  380.             }
  381.         }
  382.  
  383.         fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
  384.             if (e) throw e;
  385.         });
  386.         fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
  387.             if (e) throw e;
  388.         });
  389.     }
  390.  
  391. })
  392. ///Uploaded By L U X Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement