Guest User

By xRokz

a guest
Jul 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js")
  2. const client = new Discord.Client()
  3. const fs = require("fs")
  4. const moment = require("moment")
  5. const figlet = require("figlet")
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. var request = require('request');
  13. request('https://www.spaxrkl.gq/hypelc/api.php', function (error, response, body) {
  14.   if (!error && response.statusCode == 200) {
  15.      var importedJSON = JSON.parse(body);
  16.      
  17.   }
  18.   let hlc = importedJSON
  19.   let prefix = "<"
  20.   let color = "#000000"
  21.  
  22.   client.on('ready', () => {
  23.     client.user.setActivity(`On ${client.guilds.size} Servers | <commands for help`, "https://www.twitch.tv/HypeLC");
  24.     console.log("HypeLC is on")
  25.     console.log("info is on")
  26. })
  27.  
  28.   client.on('message', message => {
  29.     let args = message.content.split(' ').slice(1)
  30.    
  31.     if(message.content.startsWith(prefix + 'setGame')) {
  32.         if(message.guild.id != '446420187021967372') return;
  33.         else {
  34.         client.user.setActivity(args.join(' '))
  35.         message.channel.send(`**My Playing status has been changed to [ ${args.join(' ')} ]**`)
  36.     }
  37.     }
  38.     if(message.content.startsWith(prefix + 'setStreaming')) {
  39.         if(message.guild.id != '446420187021967372') return;
  40.          else {
  41.         client.user.setActivity(args.join(' '), {type: 'STREAMING', url:'https://www.twitch.com/tornado'})
  42.         message.channel.send(`**My Streaming status has been changed to [ ${args.join(' ')} ]**`)
  43.     }
  44.     }
  45.     if(message.content.startsWith(prefix + 'setListening')) {
  46.         if(message.guild.id != '446420187021967372') return;
  47.         else {
  48.         client.user.setActivity(args.join(' '), {type: 'LISTENING'})
  49.         message.channel.send(`**My Listening status has been changed to [ ${args.join(' ')} ]**`)
  50.     }
  51.     }
  52.     if(message.content.startsWith(prefix + 'setWatching')) {
  53.         if(message.guild.id != '446420187021967372') return;
  54.         else {
  55.         client.user.setActivity(args.join(' '), {type: 'WATCHING'})
  56.         message.channel.send(`**My Watching status has been changed to [ ${args.join(' ')} ]**`)
  57.     }
  58.     }
  59.    
  60.    
  61.     if(message.content === '<back') {
  62.       client.user.setActivity(prefix + `commands |On ${client.guilds.size} Servers`,'https://www.twitch.tv/Tornado%27');
  63.     }
  64.        if(message.content === '<username') {
  65.          client.user.setUsername(args);
  66.        }
  67.    
  68.      });
  69.  
  70.      
  71.  
  72. client.on('message', message => {
  73.     let args = message.content.split(" ").slice(1).join(" ")
  74.     if(message.content.startsWith(prefix + 'clear')) {
  75.         if(!args) return message.channel.send("Please put a valid number!");
  76.   message.channel.bulkDelete(args[0]).then(() => {
  77.     message.channel.send(`***${args[0]} messages have been cleared!***`).then(msg => msg.delete(5000));
  78.  
  79. })
  80.         if(args < '100') return;
  81.         if(args > '1') return;
  82.        
  83.     }
  84. })
  85. const fs = require("fs"); // npm i fs
  86. const Canvas = require("canvas"); //npm i canvas
  87. const jimp = require("jimp"); //npm i jimp
  88. // const Canvas = require("canvas-prebuilt"); // اذا كنت وندوز
  89. // npm i canvas-prebuilt
  90.  
  91. //سوي ملف اسمه profile.json وحط فيه {}
  92. //حمل الصورة من البوست حقي او من الرابط https://prnt.sc/k0vytj
  93.  
  94. let profile = JSON.parse(fs.readFileSync("./profile.json", "utf8"))
  95. client.on("message", message => {
  96.  
  97.   if (message.author.bot) return;
  98.   if(!message.channel.guild)return;
  99.   if (!profile[message.author.id]) profile[message.author.id] = {
  100.     tite: 'HypeLC User',
  101.     rep: 0,
  102.     reps: 'NOT YET',
  103.     lastDaily:'Not Collected',
  104.     level: 0,
  105.     points: 0,
  106.     credits: 1,
  107.   };
  108.  
  109.  
  110. fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
  111. if (err) console.error(err);
  112. })
  113. });
  114.  
  115. client.on('message', message => {
  116.  
  117.     if(message.content.startsWith(prefix + 'rep')) {
  118.       if(!message.channel.guild) return;
  119.                     moment.locale('en');
  120.                   var getvalueof = message.mentions.users.first()
  121.                     if(!getvalueof) return message.channel.send(`**:mag: |  ${message.author.username}, the user could not be found.    **`);
  122.                        if(getvalueof.id == message.author.id) return message.channel.send(`**${message.author.username}, you cant give yourself a reputation !**`)
  123.     if(profile[message.author.id].reps != moment().format('L')) {
  124.             profile[message.author.id].reps = moment().format('L');
  125.             profile[getvalueof.id].rep = Math.floor(profile[getvalueof.id].rep+1);
  126.          message.channel.send(`** :up:  |  ${message.author.username} has given ${getvalueof} a reputation point!**`)
  127.         } else {
  128.          message.channel.send(`**:stopwatch: |  ${message.author.username}, you can raward more reputation  ${moment().endOf('day').fromNow()} **`)
  129.         }
  130.        }
  131.        fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
  132. if (err) console.error(err);
  133. })
  134. });
  135.  
  136. client.on("message", (message) => {
  137.   let men = message.mentions.users.first()
  138.  
  139.   if (message.author.bot) return;
  140.     if (message.author.id === client.user.id) return;
  141.   if(!message.channel.guild) return;
  142. if (message.content.startsWith(prefix + 'credit')) {
  143.   if(men) {
  144.     if (!profile[men.id]) profile[men.id] = {
  145.     lastDaily:'Not Collected',
  146.     credits: 1,
  147.   };
  148.   }
  149.   if(men) {
  150. message.channel.send(`** ${men.username}, :credit_card: balance` + " is `" + `${profile[men.id].credits}$` + "`.**")
  151. } else {
  152.   message.channel.send(`** ${message.author.username}, your :credit_card: balance` + " is `" + `${profile[message.author.id].credits}$` + "`.**")
  153. }
  154. }
  155.  
  156. if(message.content.startsWith(prefix + "daily")) {
  157.   if(profile[message.author.id].lastDaily != moment().format('day')) {
  158.     profile[message.author.id].lastDaily = moment().format('day')
  159.     profile[message.author.id].credits += 200
  160.      message.channel.send(`**${message.author.username} you collect your \`200\` :dollar: daily pounds**`)
  161. } else {
  162.     message.channel.send(`**:stopwatch: | ${message.author.username}, your daily :yen: credits refreshes ${moment().endOf('day').fromNow()}**`)
  163. }
  164.   }
  165.  
  166.  let cont = message.content.slice(prefix.length).split(" ");
  167. let args = cont.slice(1);
  168. let sender = message.author
  169. if(message.content.startsWith(prefix + 'trans')) {
  170.           if (!args[0]) {
  171.             message.channel.send(`**Usage: ${prefix}trans @someone amount**`);
  172.          return;
  173.            }
  174.         // We should also make sure that args[0] is a number
  175.         if (isNaN(args[0])) {
  176.             message.channel.send(`**Usage: ${prefix}trans @someone amount**`);
  177.             return; // Remember to return if you are sending an error message! So the rest of the code doesn't run.
  178.              }
  179.             let defineduser = '';
  180.             let firstMentioned = message.mentions.users.first();
  181.             defineduser = (firstMentioned)
  182.             if (!defineduser) return message.channel.send(`**Usage: ${prefix}trans @someone amount**`);
  183.             var mentionned = message.mentions.users.first();
  184. if (!profile[sender.id]) profile[sender.id] = {}
  185. if (!profile[sender.id].credits) profile[sender.id].credits = 200;
  186. fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
  187. if (err) console.error(err);
  188. })
  189.       var mando = message.mentions.users.id;
  190.       if  (!profile[defineduser.id]) profile[defineduser.id] = {}
  191.       if (!profile[defineduser.id].credits) profile[defineduser.id].credits = 200;
  192.       profile[defineduser.id].credits += (+args[0]);
  193.       profile[sender.id].credits += (-args[0]);
  194.       let mariam = message.author.username
  195. message.channel.send(`**:moneybag: | ${message.author.username}, has transferrerd ` + "`" + args[0] + "$` to " + `<@${defineduser.id}>**`)
  196. }
  197.  
  198.       });
  199.  
  200.       client.on('message', message => {
  201.           if(!profile[message.author.id]) profile[message.author.id] ={
  202.               points: 0,
  203.               level: 1
  204.           };
  205.           if(message.author.bot) return;
  206.           profile[message.author.id].points = Math.floor(profile[message.author.id].points+1);
  207.           if(profile[message.author.id].points > 100) {
  208.               profile[message.author.id].points = 0
  209.               profile[message.author.id].level = Math.floor(profile[message.author.id].level+1);
  210.               message.channel.send(`**${message.author.username}, You leveld up to __${profile[message.author.id].level}__**`)
  211.           }
  212.           fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
  213. if (err) console.error(err);
  214. })
  215.       })
  216.  
  217.     client.on('message', message => {
  218.         let tit = message.content.split(" ").slice(1).join(" ");
  219.         if(message.content.startsWith(prefix + "title")) {
  220.         if(!profile[message.author.id].tite) profile[message.author.id].tite = "Hey im using HypeLC"
  221.         if(!tit) {
  222.             message.channel.send("**Usage: <title <something>**");
  223.         } else {
  224.             profile[message.author.id].tite = tit
  225.             message.channel.send(`:ok:`)
  226.         }
  227.         }
  228.         fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
  229. if (err) console.error(err);
  230. })
  231.     })
  232.  
  233.     client.on("message", message => {
  234.   if (message.author.bot) return;
  235.   if(!message.channel.guild) return;
  236. if (message.content.startsWith(prefix + "profile")) {
  237.                                let user = message.mentions.users.first();
  238.          var men = message.mentions.users.first();
  239.             var heg;
  240.             if(men) {
  241.                 heg = men
  242.             } else {
  243.                 heg = message.author
  244.             }
  245.           var mentionned = message.mentions.members.first();
  246.              var h;
  247.             if(mentionned) {
  248.                 h = mentionned
  249.             } else {
  250.                 h = message.member
  251.             }
  252.             var ment = message.mentions.users.first();
  253.             var getvalueof;
  254.             if(ment) {
  255.               getvalueof = ment;
  256.             } else {
  257.               getvalueof = message.author;
  258.             }
  259.    var mentionned = message.mentions.users.first();
  260.  
  261.     var client;
  262.       if(mentionned){
  263.           var client = mentionned;
  264.       } else {
  265.           var client = message.author;
  266.  
  267.       }
  268. if (!profile[getvalueof.id]) profile[getvalueof.id] = {points: 0,reps: "NOT YET",credits: 1, level: 1,tite: "HypeLC User", rep: 0, lastDaily: "NOT COLLECTED"};
  269.             let Image = Canvas.Image,
  270.             canvas = new Canvas(300, 300),
  271.             ctx = canvas.getContext('2d');
  272.             fs.readFile("./hlcpro.png", function (err, Background) { //امتداد الصورة
  273.             if (err) return console.log(err);
  274.             let BG = Canvas.Image;
  275.             let ground = new Image;
  276.             ground.src = Background;
  277.             ctx.drawImage(ground, 0, 0, 300, 300); // حجم الصورة
  278.  
  279. })
  280.  
  281.  
  282.  
  283.                 let url = getvalueof.displayAvatarURL.endsWith(".webp") ? getvalueof.displayAvatarURL.slice(5, -20) + ".png" : getvalueof.displayAvatarURL;
  284.                 jimp.read(url, (err, ava) => {
  285.                     if (err) return console.log(err);
  286.                     ava.getBuffer(jimp.MIME_PNG, (err, buf) => {
  287.                         if (err) return console.log(err);
  288.  
  289.                         //ur name
  290.                         ctx.font = 'bold 16px Arial'; // حجم الخط Ùˆ نوعه
  291.                         ctx.fontSize = '40px'; // عرض الخط
  292.                         ctx.fillStyle = "#000000"; // لون الخط
  293.                         ctx.textAlign = "center"; // محاذا Ø© النص
  294.                         ctx.fillText(`${getvalueof.username}`, 153, 173) // احداثيات اسمك
  295.  
  296.                         //ur name
  297.                         ctx.font = 'bold 16px Arial'; // حجم الخط Ùˆ نوعه
  298.                         ctx.fontSize = '40px'; // عرض الخط
  299.                         ctx.fillStyle = "#f1f1f1"; // لون الخط
  300.                         ctx.textAlign = "center"; // محاذا Ø© النص
  301.                         ctx.fillText(`${getvalueof.username}`, 151, 171) // احداثيات اسمك
  302.  
  303.                         //credit
  304.                         ctx.font = "bold 12px Arial" // نوع الخط وحجمه
  305.                         ctx.fontSize = '10px'; // عرض الخط
  306.                         ctx.fillStyle = "#f1f1f1" // لون الخط
  307.                         ctx.textAlign = "center"; // محاذا Ø© النص
  308.                         ctx.fillText(`$${profile[getvalueof.id].credits}`, 81, 159) // احداثيات المصاري
  309.  
  310.                         //poits
  311.                         ctx.font = "bold 12px Arial" // Ù†
  312.                         ctx.fontSize = '10px'; // عرض الخطوع الخط وحجمه
  313.                         ctx.fillStyle = "#f1f1f1" // لون الخط
  314.                         ctx.textAlign = "center"; // محاذا Ø© النص
  315.                         ctx.fillText(`${profile[getvalueof.id].points}`, 221, 159) // احداثيات النقاط
  316.  
  317.                         //Level
  318.                         ctx.font = "bold 27px Arial" // نوع الخط Ùˆ حجمه
  319.                         ctx.fontSize = '10px'; // عرض الخط
  320.                         ctx.fillStyle = "#f1f1f1" // لون الخط
  321.                         ctx.textAlign = "center"; // محاذا Ø© النص
  322.                         ctx.fillText(`${profile[getvalueof.id].level}`, 221, 118) // احداثيات اللفل
  323.  
  324.                          //info
  325.                         ctx.font = "bold 12px Arial" // Ù†
  326.                         ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
  327.                         ctx.fillStyle = "#000000" // لون الخط
  328.                         ctx.textAlign = "center"; // محاذا Ø© النص
  329.                         ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 199) // احداثيات النقاط
  330.  
  331.                         //info
  332.                         ctx.font = "bold 12px Arial" // Ù†
  333.                         ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
  334.                         ctx.fillStyle = "#f1f1f1" // لون الخط
  335.                         ctx.textAlign = "center"; // محاذا Ø© النص
  336.                         ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 197) // احداثيات النقاط
  337.  
  338.                         // REP
  339.                         ctx.font = "bold 26px  Arial";
  340.                         ctx.fontSize = "50px";
  341.                         ctx.fillStyle = "#f1f1f1";
  342.                         ctx.textAlign = "center";
  343.                         ctx.fillText(`+${profile[getvalueof.id].rep}`, 80,117)
  344.  
  345.                         let Avatar = Canvas.Image;
  346.                         let ava = new Avatar;
  347.  
  348. ava.src = buf;
  349.                         ctx.beginPath();
  350.                         ctx.arc(75, 100, 780, 0, Math.PI*2, true);
  351.                         ctx.closePath();
  352.                         ctx.clip();
  353.                         ctx.drawImage(ava, 116, 82, 72, 72);
  354.  
  355. message.channel.startTyping()
  356. message.channel.sendFile(canvas.toBuffer())
  357. message.channel.stopTyping()
  358. })
  359. })
  360. }
  361. });
  362.  
  363. client.on('message', message => {
  364.    
  365.     if(message.content.startsWith(prefix + 'info')) {
  366.         const embed = new Discord.RichEmbed()
  367.         .setTitle("**Server Info**")
  368.         .setColor(color)
  369.         .addField("**:sparkles:Server Name**", `**[${message.guild.name}]**`, true)
  370.         .addField('**:crown:Server Owner**', `**[${message.guild.owner}]**`, true)
  371.         .addField("**:date:Created At**", `**[${message.guild.createdAt.toLocaleString()}]**`)
  372.         .addField("**:family_wwb:Members**", `**[${message.guild.memberCount}]**`,true)
  373.         .addField("**:large_orange_diamond:Roles**", `**[${message.guild.roles.size}]**`,true)
  374.         message.channel.send({embed})
  375.     }
  376. })
  377.  
  378. client.on('message', message => {
  379.     if(message.content.startsWith(prefix + 'ping')) {
  380. message.channel.send(`**:ping_pong:Pong [${Date.now() - message.createdTimestamp}]**`)
  381.     }
  382. })
  383.  
  384. client.on('message', message => {
  385.     let args = message.content.split(" ").slice(1).join(" ")
  386.     if(message.content.startsWith(prefix + 'sg')) {
  387.         if(!args) return message.channel.send("```Usage: <sg {any thing}```")
  388.         let channelsg = message.guild.channels.find("name", "suggestions")
  389.         const embed = new Discord.RichEmbed()
  390.         .setTitle("New Suggestions")
  391.         .setColor(color)
  392.         .addField("By:", message.author.username)
  393.         .addField("Date:", message.createdAt.toLocaleString())
  394.         .addField("Message", "```" + args + "```")
  395.         if(!channelsg) return message.channel.send("**Try again please**").then(message.guild.createChannel("suggestions", "text"));
  396.         channelsg.send({embed}).then(message.channel.send("**Your suggestion has been successfuly sent to ** #suggestions"))
  397.     }
  398. })
  399.  
  400. client.on('message', message => {
  401.     let args = message.content.split(" ").slice(0).join(" ")
  402.     if(message.content.includes("https://")) {
  403.        
  404.     }  
  405. })
  406.  
  407. client.on('message', message => {
  408. if (message.content.startsWith(prefix + "uptime")) {
  409.    let uptime = client.uptime;
  410.  
  411.    let days = 0;
  412.    let hours = 0;
  413.    let minutes = 0;
  414.    let seconds = 0;
  415.    let notCompleted = true;
  416.  
  417.    while (notCompleted) {
  418.  
  419.        if (uptime >= 8.64e+7) {
  420.  
  421.            days++;
  422.            uptime -= 8.64e+7;
  423.  
  424.        } else if (uptime >= 3.6e+6) {
  425.  
  426.            hours++;
  427.            uptime -= 3.6e+6;
  428.  
  429.        } else if (uptime >= 60000) {
  430.  
  431.            minutes++;
  432.            uptime -= 60000;
  433.  
  434.        } else if (uptime >= 1000) {
  435.            seconds++;
  436.            uptime -= 1000;
  437.  
  438.        }
  439.  
  440.        if (uptime < 1000)  notCompleted = false;
  441.  
  442.    }
  443.  
  444.    message.channel.send("`" + `${days} days, ${hours} hrs, ${minutes} min , ${seconds} sec` + "`");
  445.  
  446.  
  447. }
  448. });
  449.  
  450. client.on('message', message => {
  451.  
  452. if(message.content.startsWith(prefix + 'name')) {
  453.     message.channel.send(`Our name is **${hlc.name}**`)
  454. }
  455.  
  456. if(message.content.startsWith(prefix + 'author')) {
  457.     message.channel.send(`Our authors is **${hlc.author}**`)
  458. }
  459.  
  460. if(message.content.startsWith(prefix + 'maincolor')) {
  461.     message.channel.send(`Our color is **${color}**`)
  462. }
  463.  
  464. if(message.content.startsWith(prefix + 'website')) {
  465.     message.channel.send(`Our website is **${hlc.website}**`)
  466. }
  467.  
  468. if(message.content.startsWith(prefix + 'prefix')) {
  469.     message.channel.send(`Our prefix is **${prefix}**`)
  470. }
  471.  
  472. if(message.content.startsWith(prefix + 'mainlang')) {
  473.     message.channel.send(`Our lang is **${hlc.mainlang}**`)
  474. }
  475.  
  476. if(message.content.startsWith(prefix + 'languages')) {
  477.     message.channel.send(`Our prog lang is **${hlc.languages}**`)
  478. }
  479.  
  480. })
  481.  
  482. client.on('message',message =>{
  483.     if(message.content == prefix + "sex"){
  484. message.guild.fetchInvites().then(i =>{
  485. var invites = [];
  486.  
  487. i.forEach(inv =>{
  488.     var [invs,i]=[{},null];
  489.    
  490.     if(inv.maxUses){
  491.         invs[inv.code] =+ inv.uses+"/"+inv.maxUses;
  492.     }else{
  493.         invs[inv.code] =+ inv.uses;
  494.     }
  495.         invites.push(`invite: ${inv.url} inviter: ${inv.inviter} \`${invs[inv.code]}\`;`);
  496.  
  497. });
  498.   message.channel.send(invites.join(`\n`)+'\n\n**By:** '+message.author);
  499.  
  500. });
  501.  
  502.     }
  503. });
  504.  
  505. client.on('message', message => {
  506.     if (message.content.startsWith(prefix + "hack")) {
  507.         if(!message.author.id === '') return;
  508.       if (message.author.bot) return
  509.            message.delete();
  510.              let args = message.content.split(' ').slice(1);
  511.  
  512.                    let virusname = args.join(' ');
  513.                  if (virusname < 1) {
  514.                      return message.channel.send("```اكتب اسم الشخص الي تبي يتهكر```");
  515.                  }
  516.                  message.channel.send({embed: new Discord.RichEmbed().setTitle('Loading ' + virusname + "...").setColor(color)}).then(function(m) {
  517.              setTimeout(function() {
  518.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“ ] 1%').setColor(color)})
  519.              }, 1000)
  520.              setTimeout(function() {
  521.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“ ] 2%').setColor(color)})
  522.              }, 2000)
  523.                setTimeout(function() {
  524.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“ ] 3%').setColor(color)})
  525.              }, 3000)
  526.              setTimeout(function() {
  527.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“ ] 4%').setColor(color)})
  528.              }, 4000)
  529.                setTimeout(function() {
  530.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 28%').setColor(color)})
  531.              }, 5000)
  532.                setTimeout(function() {
  533.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 35%').setColor(color)})
  534.              }, 6000)
  535.                setTimeout(function() {
  536.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 78%').setColor(color)})
  537.              }, 7000)
  538.                setTimeout(function() {
  539.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 80%').setColor(color)})
  540.              }, 8000)
  541.                setTimeout(function() {
  542.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 86%').setColor(color)})
  543.              }, 9000)
  544.                 setTimeout(function() {
  545.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 89%').setColor(color)})
  546.              }, 10000)
  547.                 setTimeout(function() {
  548.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 90%').setColor(color)})
  549.              }, 11000)
  550.                 setTimeout(function() {
  551.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 95%').setColor(color)})
  552.              }, 12000)
  553.                 setTimeout(function() {
  554.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 96%').setColor(color)})
  555.              }, 13000)
  556.                 setTimeout(function() {
  557.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“ ] 97%').setColor(color)})
  558.              }, 14000)
  559.                 setTimeout(function() {
  560.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“] 98%').setColor(color)})
  561.              }, 15000)
  562.                 setTimeout(function() {
  563.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓���▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ] 99%').setColor(color)})
  564.              }, 16000)
  565.                 setTimeout(function() {
  566.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Loading Discord Virus [â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“] 100%').setColor(color)})
  567.              }, 17000)
  568.              setTimeout(function() {
  569.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']:' + virusname + 'done it\'s going good 100.9%').setColor(color)})
  570.              }, 18000)
  571.                 setTimeout(function() {
  572.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: hacking yeah i love it').setColor(color)})
  573.              }, 19000)
  574.                setTimeout(function() {
  575.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: uploading data' + virusname + ".key").setColor(color)})
  576.              }, 22000)
  577.                setTimeout(function() {
  578.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Uploaded! Initiating explosion in 5...').setColor(color)})
  579.              }, 25000)
  580.                setTimeout(function() {
  581.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Uploaded! Initiating explosion in 4...').setColor(color)})
  582.              }, 26000)
  583.                 setTimeout(function() {
  584.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Uploaded! Initiating explosion in 3...').setColor(color)})
  585.              }, 27000)
  586.                 setTimeout(function() {
  587.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Uploaded! Initiating explosion in 2...').setColor(color)})
  588.              }, 28000)
  589.                 setTimeout(function() {
  590.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: Uploaded! Initiating explosion in 1...').setColor(color)})
  591.              }, 29000)
  592.              setTimeout(function() {
  593.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“] 99%').setColor(color)})
  594.            }, 30000)
  595.               setTimeout(function() {
  596.                m.edit({embed: new Discord.RichEmbed().setTitle('[' + virusname + ']: â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“â–“]100% virus added').setColor(color)})
  597.            }, 31000)
  598.               setTimeout(function() {
  599.                m.delete()
  600.            }, 32000)
  601.              setTimeout(function() {
  602.                message.channel.send('تم تهكيرك')
  603.            }, 33000)
  604.            });
  605.          }
  606.  })
  607.  
  608.  
  609.  client.on('message', message => {
  610.     if (message.content.startsWith(prefix + "avatar")) {
  611.         var men = message.mentions.users.first();
  612.     var user;
  613.       if(men){
  614.           var user = men;
  615.       } else {
  616.           var user = message.author;
  617.  
  618.       }
  619.         const embed = new Discord.RichEmbed()
  620.         .setColor(color)
  621.         .setImage(`${user.avatarURL}`)
  622.       message.channel.send({embed}).catch(console.error);
  623.     }
  624. });
  625.  
  626. client.on("message", message => {
  627.     if (message.author.bot) return;
  628. if (!message.channel.guild) return;
  629. if(message.content === prefix + 'bot') {
  630. if(!message.channel.guild) return;
  631.     let uptime = client.uptime;
  632.  
  633. let days = 0;
  634. let hours = 0;
  635. let minutes = 0;
  636. let seconds = 0;
  637. let notCompleted = true;
  638.  
  639. while (notCompleted) {
  640.  
  641.     if (uptime >= 8.64e+7) {
  642.  
  643.         days++;
  644.         uptime -= 8.64e+7;
  645.  
  646.     } else if (uptime >= 3.6e+6) {
  647.  
  648.         hours++;
  649.         uptime -= 3.6e+6;
  650.  
  651.     } else if (uptime >= 60000) {
  652.  
  653.         minutes++;
  654.         uptime -= 60000;
  655.  
  656.     } else if (uptime >= 1000) {
  657.         seconds++;
  658.         uptime -= 1000;
  659.  
  660.     }
  661.  
  662.     if (uptime < 1000)  notCompleted = false;
  663.  
  664. }
  665. moment.locale("en-ca")
  666. let status = new Discord.RichEmbed()
  667. .setColor(color)
  668. .setAuthor(client.user.username,client.user.avatarURL)
  669. .setThumbnail(client.user.avatarURL)
  670. .setDescription(`
  671. MyPrefix : **[ ${prefix} ]**
  672. Guilds : **[ ${client.guilds.size} ]**
  673. Channels : **[ ${client.channels.size} ]**
  674. Users : **[ ${client.users.size} ]**
  675. MyName : **[ ${client.user.username} ]**
  676. MyID : **[ ${client.user.id} ]**
  677. RamUsage : **[ ${(process.memoryUsage().rss / 1048576).toFixed()}MB ]**
  678. CreatedAt : **[ ${moment(client.user.createdAt).fromNow()} ]**
  679. `);
  680. let id = message.author.id;
  681.  
  682.         message.channel.send({embed:status});
  683.  
  684.  
  685. }
  686. });
  687.  
  688. var UserBlocked = new Set();
  689.  
  690. var fkk =[
  691.     {f:" بسم الله الرحمن الرحيم",k:"ب س Ù… ا Ù„ Ù„ Ù‡ ا Ù„ ر Ø­ Ù… Ù† ا Ù„ ر Ø­ ÙŠ Ù…"},
  692.     {f:" باص",k:"ب ا ص"},
  693.     {f:" عربة ",k:"ع ر ب Ø©"},
  694.     {f:" سيارة",k:"س ÙŠ ا ر Ø©"},
  695.     {f:" سيرفرنا احلى سيرفر",k:"س ÙŠ ر ف ر Ù† ا ا Ø­ Ù„ Ù‰ س ÙŠ ر ف ر"},
  696.     {f:" العنود ",k:"ا Ù„ ع Ù† Ùˆ د"},
  697.     {f:" المستتكعكبتيه",k:"ا Ù„ Ù… س ت ت Ùƒ ع Ùƒ ب ت ÙŠ Ù‡"},
  698.     {f:" دحوم",k:"د Ø­ Ùˆ Ù…"},
  699.     {f:" اونرنا احلى اونر",k:"ا Ùˆ Ù† ر Ù† ا ا Ø­ Ù„ Ù‰ ا Ùˆ Ù† ر"},
  700.     {f:" الحياة حلوة",k:"ا Ù„ Ø­ ÙŠ ا Ø© Ø­ Ù„ Ùˆ Ø©"},
  701.     {f:" كازخستان ",k:"Ùƒ ا ز Ø® س ت ا Ù†"},
  702.     {f:"لحم الحمام حلال ولحم الحمار حرام ",k:"Ù„ Ø­ Ù… ا Ù„ Ø­ Ù… ا Ù… Ø­ Ù„ ا Ù„ Ùˆ Ù„ Ø­ Ù… ا Ù„ Ø­ Ù… ا ر Ø­ ر ا Ù…"},
  703.     {f:" استونيا ",k:"ا س ت Ùˆ Ù† ÙŠ ا"},
  704.     {f:" لقمة وجغمه ",k:"Ù„ Ù‚ Ù… Ø© Ùˆ ج غ Ù… Ù‡"},
  705.     {f:" زنديق  ",k:"ز Ù† د ÙŠ Ù‚"},
  706.     {f:" استراليا ",k:"ا س ت ر ا Ù„ ÙŠ ا"},
  707.     {f:" سوريا ",k:"س Ùˆ ر ÙŠ ا"},
  708.     {f:" الاردن ",k:"ا Ù„ ا ر د Ù†"},
  709.     {f:" طماطم ",k:"Ø· Ù… ا Ø· Ù…"},
  710.     {f:" سارة ",k:"س ا ر Ø©"},
  711.     {f:" دراجون ",k:"د ر ا ج Ùˆ Ù†"},
  712.     {f:" سيرفر ",k:"س ÙŠ ر ف ر"},
  713.     {n:" الجبل",m:"ا Ù„ ج ب Ù„"},
  714.     {n:" هضبة",m:"Ù‡ ض ب Ø©"},
  715.     {n:" خواطر",m:"Ø® Ùˆ ا Ø· ر"},
  716.     {n:" ارحبو",m:"ا ر Ø­ ب Ùˆ"},
  717.     {n:" اطنخ سيرفر",m:"ا Ø· Ù† Ø® س ÙŠ ف ر"},
  718.     {n:" احبك",m:"ا Ø­ ب Ùƒ"},
  719.     {n:" سبرايز",m:"س ب ر ا ÙŠ ز"},
  720.     {n:" ولي على أمتك",m:"Ùˆ Ù„ ÙŠ ع Ù„ Ù‰ Ø£ Ù… ت Ùƒ"},
  721.  
  722.  
  723.  
  724. ];
  725.  
  726. let fkkpts = JSON.parse(fs.readFileSync("./pts.json", "utf8"))
  727.  
  728. client.on("message", async message => {
  729.     if(!fkkpts[message.author.id]) fkkpts[message.author.id] = {
  730.         wins: "0",
  731.         losses: "0",
  732.         points: "0"
  733.     }
  734. if(message.content == prefix + "fkk"){
  735.     if(UserBlocked.has(message.guild.id)) return message.channel.send("هناك جلسة .")
  736.     UserBlocked.add(message.guild.id)
  737.     var ask = fkk[Math.floor(Math.random() * fkk.length)];
  738.     let embed = new Discord.RichEmbed()
  739.     .setTitle('لعبة فكك')
  740.     .setAuthor(message.author.username, message.author.avatarURL)
  741.     .setColor(color)
  742.     .setDescription(ask.f);
  743.     message.channel.sendEmbed(embed).then(msg=> msg.delete(200000))
  744.     const msgs = await message.channel.awaitMessages(msg => msg.author.id !== client.user.id ,{maxMatches:1,time:100000});
  745.         UserBlocked.delete(message.guild.id)
  746.     msgs.forEach(result => {
  747.        if(result.author.id == client.user.id) return;
  748.        if(result.content == "فكك") return
  749.        if(result.content == ask.k){
  750.  
  751.          let embeds = new Discord.RichEmbed()
  752.          .setTitle(':white_check_mark: اجابة صحيحة')
  753.          .setAuthor(message.author.username, message.author.avatarURL)
  754.          .setColor(color)
  755.          .setDescription(`**${result.author.username}** الإجابة صحيحة`)
  756.          .addField("لقد ربحت","15 نقطه", true)
  757.             message.channel.sendEmbed(embeds)
  758.             fkkpts[message.author.id].wins = Math.floor(fkkpts[message.author.id].wins+1)
  759.             fkkpts[message.author.id].points = Math.floor(fkkpts[message.author.id].points+15);               return;
  760.        } else {
  761.  
  762.                            var embedx = new Discord.RichEmbed()
  763.          .setTitle(':x:خطاء')
  764.          .setAuthor(message.author.username, message.author.avatarURL)
  765.          .setColor(color)
  766.          .setDescription(`**${result.author.username}** الإجابة خاطئة `,true)
  767.          .addField("**الاجابه الصحيحه هي**",`**[${ask.k}]**`,true)
  768.          .addField("لقد خسرت","15 نقطه",true)
  769.  
  770.             message.channel.sendEmbed(embedx)
  771.             fkkpts[message.author.id].losses = Math.floor(fkkpts[message.author.id].losses+1)
  772.             fkkpts[message.author.id].points = Math.floor(fkkpts[message.author.id].points-15)
  773.                }
  774.  });
  775. }
  776.  
  777. if(message.content.startsWith(prefix + "points fkk")) {
  778.     const embedp = new Discord.RichEmbed()
  779.     .setAuthor(message.author.username, message.author.avatarURL)
  780.     .setColor(color)
  781.     .setDescription("**" + message.author.username + "'s points**")
  782.     .addField("**:trophy:Points:**", `**[ ${fkkpts[message.author.id].points} ]**`,true)
  783.     .addField("**:white_check_mark:Wins:**", `**[ ${fkkpts[message.author.id].wins} ]**`,true)
  784.     .addField("**:x:Losses:**", `**[ ${fkkpts[message.author.id].losses} ]**`,true)
  785.     message.channel.send({embed:embedp})
  786. }
  787.  
  788. fs.writeFile("./pts.json", JSON.stringify(fkkpts), (err) => {
  789.     if (err) console.error(err)
  790.   });
  791.  
  792. });    
  793.  
  794. var math2 =[
  795.     {f:"2*5",k:"10"},
  796.     {f:"1+2",k:"3"},
  797.     {f:"5*4",k:"20"},
  798.     {f:"2+9",k:"11"},
  799.     {f:"G+G",k:"GG"},
  800.     {f:"0*8",k:"0"},
  801.     {f:" 5-2",k:"3"},
  802.     {f:"1+2-2*1",k:"1"},
  803.     {f:"5/0.5",k:"2.5"},
  804.     {f:"66-6",k:"60"},
  805.     {f:" 12*12",k:"144"},
  806.     {f:"5*20",k:"100"},
  807.     {f:" 1+5-4",k:"2"},
  808.     {f:"100/5",k:"20"},
  809.     {f:"0*1*2*3*4*5*6*7*8*9",k:"0"},
  810. ];
  811.  
  812. let math = JSON.parse(fs.readFileSync("./math.json", "utf8"))
  813.  
  814. client.on("message", async message => {
  815.     if(!math[message.author.id]) math[message.author.id] = {
  816.         wins: "0",
  817.         losses: "0",
  818.         points: "0"
  819.     }
  820. if(message.content == prefix + "math"){
  821.     if(UserBlocked.has(message.guild.id)) return message.channel.send("There is a game....")
  822.     UserBlocked.add(message.guild.id)
  823.     var ask = math2[Math.floor(Math.random() * math2.length)];
  824.     let embed = new Discord.RichEmbed()
  825.     .setTitle('Math...')
  826.     .setAuthor(message.author.username, message.author.avatarURL)
  827.     .setColor(color)
  828.     .setDescription(ask.f);
  829.     message.channel.sendEmbed(embed).then(msg=> msg.delete(200000))
  830.     const msgs = await message.channel.awaitMessages(msg => msg.author.id !== client.user.id ,{maxMatches:1,time:100000});
  831.         UserBlocked.delete(message.guild.id)
  832.     msgs.forEach(result => {
  833.        if(result.author.id == client.user.id) return;
  834.        if(result.content == "math") return
  835.        if(result.content == ask.k){
  836.  
  837.          let embeds = new Discord.RichEmbed()
  838.          .setTitle(':white_check_mark: اجابة صحيحة')
  839.          .setAuthor(message.author.username, message.author.avatarURL)
  840.          .setColor(color)
  841.          .setDescription(`**${result.author.username}** الإجابة صحيحة`)
  842.          .addField("لقد ربحت","15 نقطه", true)
  843.             message.channel.sendEmbed(embeds)
  844.             math[message.author.id].wins = Math.floor(math[message.author.id].wins+1)
  845.             math[message.author.id].points = Math.floor(math[message.author.id].points+15);               return;
  846.        } else {
  847.  
  848.                            var embedx = new Discord.RichEmbed()
  849.          .setTitle(':x:خطاء')
  850.          .setAuthor(message.author.username, message.author.avatarURL)
  851.          .setColor(color)
  852.          .setDescription(`**${result.author.username}** الإجابة خاطئة`,true)
  853.          .addField("**الاجابه الصحيحه هي**",`**[${ask.k}]**`,true)
  854.          .addField("لقد خسرت","15 نقطه",true)
  855.  
  856.             message.channel.sendEmbed(embedx)
  857.             math[message.author.id].losses = Math.floor(math[message.author.id].losses+1)
  858.             math[message.author.id].points = Math.floor(math[message.author.id].points-15)
  859.                }
  860.  });
  861. }
  862.  
  863. if(message.content.startsWith(prefix + "points math")) {
  864.     const embedp = new Discord.RichEmbed()
  865.     .setAuthor(message.author.username, message.author.avatarURL)
  866.     .setColor(color)
  867.     .setDescription("**" + message.author.username + "'s points**")
  868.     .addField("**:trophy:Points:**", `**[ ${math[message.author.id].points} ]**`,true)
  869.     .addField("**:white_check_mark:Wins:**", `**[ ${math[message.author.id].wins} ]**`,true)
  870.     .addField("**:x:Losses:**", `**[ ${math[message.author.id].losses} ]**`,true)
  871.     message.channel.send({embed:embedp})
  872. }
  873.  
  874. fs.writeFile("./math.json", JSON.stringify(math), (err) => {
  875.     if (err) console.error(err)
  876.   });
  877.  
  878. });
  879.  
  880. client.on('message', message =>{
  881.     let args = message.content.split(" ").slice(2).join(" ")
  882.     let men = message.mentions.users.first()
  883.     let mas = message.author
  884.     if(message.content.startsWith(prefix + 'poke')) {
  885.         if(!args) return message.channel.send("**```Usage: " + prefix + 'poke <@someone> <message>```');
  886.         if(!men) return message.channel.send("**```Usage: " + prefix + 'poke <@someone> <message>```');
  887.         client.users.get(men.id).sendMessage(
  888.             `<@${men.id}>
  889.             **${mas.username} Poked you !**
  890.         **With message: ${args}**`
  891.         )
  892.     }
  893. })
  894.  
  895. client.on('message', message => {
  896.     let args = message.content.split(" ").slice(1).join(" ")
  897.     if(message.content.startsWith(prefix + "test")) {
  898.            
  899.         args = args.replace(`[server]`, `${message.guild.name}`)
  900.         args = args.replace(`[user]`, `${message.author.username}`)
  901.             message.channel.send(`${args}`)
  902.     }
  903. })
  904.  
  905.  
  906. client.on('ready', () => {
  907.     console.log('By NightMarE Enjoy');
  908.   });
  909.  
  910. client.on('message', message => {
  911.     if(!message.author.id === '375761288518828042') return;
  912.             if (message.content.startsWith(prefix + "id")) {
  913.              if(message.author.id === '375761288518828042')
  914.       var args = message.content.split(" ").slice(1);
  915.       let user = message.mentions.users.first();
  916.       var men = message.mentions.users.first();
  917.          var heg;
  918.          if(men) {
  919.              heg = men
  920.          } else {
  921.              heg = message.author
  922.          }
  923.        var mentionned = message.mentions.members.first();
  924.           var h;
  925.          if(mentionned) {
  926.              h = mentionned
  927.          } else {
  928.              h = message.member
  929.          }
  930.                 moment.locale('en-TN');
  931.        var id = new  Discord.RichEmbed()
  932.      .setColor(color)
  933.          .setThumbnail(message.author.avatarURL)
  934.          .setAuthor(` ${message.author.username} `, message.author.avatarURL)
  935.        .addField(': Created at', `${moment(heg.createdTimestamp).format('YYYY/M/D HH:mm')} **\n** \`${moment(heg.createdTimestamp).fromNow()}\`` ,true)
  936.      .addField(': Joined the server since', `${moment(h.joinedAt).format('YYYY/M/D HH:mm')} \n \`${moment(h.joinedAt).fromNow()}\``, true)
  937.      .setFooter(`${message.author.username}`, 'https://images-ext-2.discordapp.net/external/JpyzxW2wMRG2874gSTdNTpC_q9AHl8x8V4SMmtRtlVk/https/orcid.org/sites/default/files/files/ID_symbol_B-W_128x128.gif')
  938.      message.channel.send(id)
  939.  }       });
  940.  
  941.  client.on('message', message => {
  942.     const figlet = require("figlet")
  943.   if (message.content.startsWith(prefix + 'sexKtaby')) {
  944.       let args = message.content.split(" ").slice(1);
  945.   if(!args[0]) return message.reply('مرجو كتابة نص الدي تريد');
  946.  
  947.       figlet(args.join(" "), (err, data) => {
  948.                 message.channel.send("```" + data + "```")
  949.              })
  950.   }
  951.   });
  952.  
  953. client.on('message', message => {
  954.     ;
  955.     if (message.author.boss) return;
  956.     if (!message.content.startsWith(prefix)) return;
  957.     let command = message.content.split(" ")[0];
  958.     command = command.slice(prefix.length);
  959.     if (command == "addRole") {
  960.     if (!message.channel.guild) return;
  961.     if(!message.guild.member(message.author).hasPermission("MANAGE_ROLES")) return message.reply("**:no_entry_sign:You Dont have perms ... **").then(msg => msg.delete(5000));;
  962.     if(!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("I dont have perms... ").then(msg => msg.delete(5000));;
  963.     let user = message.mentions.users.first();
  964.     if (message.mentions.users.size < 1) return message.reply('**Mention someone!**').then(msg => {msg.delete(5000)});
  965.     let MRole = message.content.split(" ").slice(2).join(" ");
  966.     if(!MRole)return message.reply("Role name !").then(msg => {msg.delete(5000)});
  967.     message.guild.member(user).addRole(message.guild.roles.find("name", MRole));
  968.     message.reply('*** Done :white_check_mark:  ***').then(msg => {msg.delete(10000)});
  969.     }
  970.     });
  971.  
  972.     client.on('message', message => {
  973.    
  974.         if (message.author.boss) return;
  975.         if (!message.content.startsWith(prefix)) return;
  976.         let command = message.content.split(" ")[0];
  977.         command = command.slice(prefix.length);
  978.         if (command == "removeRole") {
  979.         if (!message.channel.guild) return;
  980.         if(!message.guild.member(message.author).hasPermission("MANAGE_ROLES")) return message.reply("**:no_entry_sign:You Dont have perms ... **").then(msg => msg.delete(5000));;
  981.         if(!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("I dont have perms... ").then(msg => msg.delete(5000));;
  982.         let user = message.mentions.users.first();
  983.         if (message.mentions.users.size < 1) return message.reply('**Mention someone!**').then(msg => {msg.delete(5000)});
  984.         let MRole = message.content.split(" ").slice(2).join(" ");
  985.         if(!MRole)return message.reply("Role name !").then(msg => {msg.delete(5000)});
  986.         message.guild.member(user).removeRole(message.guild.roles.find("name", MRole));
  987.         message.reply('*** Done :white_check_mark:  ***').then(msg => {msg.delete(10000)});
  988.         }
  989.         });
  990.    
  991.     client.on("message", message => {
  992.   if(message.content.startsWith(prefix+'serial')){
  993.      //  if(!message.channel.guild) return message.reply('** This command only for servers**');
  994.       const hex = require('hex.js');
  995.       const args = message.content.split(' ').slice(1).join(' ');
  996.       message.channel.send('**Your Serial ** :'+hex.hex(args));
  997.   }
  998.  
  999.   if(message.content.startsWith(prefix+'unserial')){
  1000.        if(!message.channel.guild) return message.reply('** This command only for servers**');
  1001.       const hex = require('hex.js');
  1002.       const args = message.content.split(' ').slice(1).join(' ');
  1003.      
  1004.       message.channel.send('**Done :** '+hex.unHex(args));
  1005.      
  1006.   }
  1007. })
  1008.  
  1009. let lvl = JSON.parse(fs.readFileSync("./level.json", "utf8"))
  1010.  
  1011. client.on('message', message => {
  1012.   if(!message.channel.guild) return;
  1013.   if(message.author.bot) return;
  1014.   if(!lvl[message.author.id]) lvl[message.author.id] = {
  1015.     points: 0,
  1016.     level: 0
  1017.   }
  1018.  
  1019.   lvl[message.author.id].points = Math.floor(lvl[message.author.id].points + 1)
  1020.  
  1021.   if(lvl[message.author.id].points == 100) {
  1022.   lvl[message.author.id].points = 0
  1023.     lvl[message.author.id].level = Math.floor(lvl[message.author.id].level + 1)
  1024.     message.channel.send(`**Congratz ${message.author.username}, You reached new level** __${lvl[message.author.id].level}__.`)
  1025.   }
  1026.  
  1027.   if(message.content.startsWith(prefix + 'level')) {
  1028.     message.channel.send(`**${message.author.username}, Your level is:** __${lvl[message.author.id].level}__`)
  1029.   }
  1030.  
  1031.   fs.writeFile("./level.json", JSON.stringify(lvl), (err) => {
  1032.     if(err) console.log(err)
  1033.   })
  1034. })
  1035.  
  1036. const pretty = require('pretty-ms');
  1037. const rn = require('random-number');
  1038. let done = {};
  1039.  
  1040. ////////////RANK
  1041.  
  1042. let userData = JSON.parse(fs.readFileSync("./userData.json", "utf8"))
  1043.  
  1044. client.on("message", function(message){
  1045. if (message.content.startsWith(prefix + "rank")) {
  1046.   if (!userData[message.author.id]) {
  1047.     userData[message.author.id] = {Money:0,Xp:0,Level:0}
  1048.   }
  1049.      var mentionned = message.mentions.users.first();
  1050.  
  1051.       var x5bzm;
  1052.       if(mentionned){
  1053.           var x5bzm = mentionned;
  1054.       } else {
  1055.           var x5bzm = message.author;
  1056.          
  1057.       }
  1058.   fs.writeFile("./userData.json",JSON.stringify(userData), function(err){
  1059.     if (err) console.log(err);
  1060.   })
  1061.   var CulLevel = Math.floor(0.25 * Math.sqrt(userData[message.author.id].Xp +1));
  1062.   if (CulLevel > userData[message.author.id].Level) {userData[message.author.id].Level +=CulLevel}
  1063.   let pEmbed = new Discord.RichEmbed()
  1064.   .setColor("Random")
  1065.   .addField("Name:", message.author.tag)
  1066.   .addField("Level:", userData[message.author.id].Level)
  1067.   .addField("Xp:",Math.floor(userData[message.author.id].Xp))
  1068.   .addField("Money:",Math.floor(userData[x5bzm.id].money))
  1069.   message.channel.send(pEmbed);
  1070. }
  1071. if (!userData[message.author.id]) {
  1072.   userData[message.author.id] = {Money:0,Xp:0,Level:0,Like:0}
  1073.   }
  1074.  
  1075.   fs.writeFile("./userData.json",JSON.stringify(userData), function(err){
  1076.     if (err) console.log(err);
  1077.   })
  1078. userData[message.author.id].Xp+= 0.25;
  1079. userData[message.author.id].Money+= 0.25;
  1080.  
  1081. });
  1082.  
  1083. ////////////REP
  1084.  
  1085. let rep = JSON.parse(fs.readFileSync("./rep.json", "utf8"));
  1086. client.on('message', message => {
  1087.   let lvlmen;
  1088.   if(lvlmen) {
  1089.     let lvlmen = message.mentions.users.first()
  1090.   }
  1091.   if(!lvlmen) {
  1092.     let lvlmen = message.author
  1093.   }
  1094.     if(!rep[message.author.id]) rep[message.author.id] = {
  1095.         reps: 'NOT YET',
  1096.         repo: 0,
  1097.     }
  1098.     if(message.content.startsWith(prefix + 'rep')) {
  1099.       if(!message.channel.guild) return;
  1100.                     moment.locale('ar');
  1101.         let ment = message.mentions.users.first();
  1102.        var getvalueof;
  1103.        if(ment) {
  1104.            getvalueof = ment;
  1105.     } else {
  1106.            getvalueof = message.author;
  1107.     }
  1108.     if(rep[message.author.id].reps != moment().format('L')) {
  1109.             rep[message.author.id].reps = moment().format('L');
  1110.             rep[getvalueof.id].repo += 1; // يضيف واحد كل مره يستخدم الامر
  1111.             message.channel.send(`** :white_check_mark: Successfly Added rep To ${getvalueof} **`)
  1112.         } else {
  1113.            message.channel.send(`** You Do it Befor \' Pls Try Agin After:`  + moment().endOf('day').fromNow().replace('in ', 'بعد ') + '**')
  1114.        }
  1115.       }
  1116.    fs.writeFile('./rep.json', JSON.stringify(rep), (err) => {
  1117.     if(err) throw err.message + ' '+err.file;
  1118. })
  1119. });
  1120.  
  1121. ////////////PROFILE
  1122.  
  1123. client.on("message",  message => {
  1124. let men = message.mentions.users.first()
  1125.      var z;
  1126.      if(men){
  1127.          var z = men;
  1128.      } else {
  1129.          var z = message.author;
  1130.          
  1131.      }
  1132.     let ment = message.mentions.users.first();
  1133.       var getvalueof;
  1134.       if(ment) {
  1135.           getvalueof = ment;
  1136.    } else {
  1137.           getvalueof = message.author;
  1138.    }
  1139.    if(message.author.bot) return;
  1140.    if(message.channel.type ==="dm") return;
  1141.    let messageArray = message.content.split(" ");
  1142.    let command = messageArray[0];
  1143.    let args = messageArray.slice(1);
  1144.    let msg = message.content.toUpperCase();
  1145.    if(!command.startsWith(prefix)) return;
  1146.    
  1147.    var jimp = require('jimp')
  1148.    const w = ['./images_profile/1.png',];
  1149.    if(command === prefix + 'pro3file') {
  1150.    let Canvas = require('canvas')
  1151.    let canvas = new Canvas(500, 500)
  1152.  
  1153.    let ctxx = canvas.getContext('3d')
  1154.    let Images = Canvas.Image
  1155.    fs.readFile(__dirname + '/images_profile/1.png', function(err, picture) {
  1156.      if (err) throw err
  1157.      var img = new Images
  1158.      img.onload = () => {
  1159.        ctx.drawImage(img, 5, 5, 500, 500)
  1160.      }
  1161.      img.src = picture
  1162.    })
  1163.    
  1164.    let ctx = canvas.getContext('2d')
  1165.    let Image = Canvas.Image
  1166.    fs.readFile(__dirname + '/images_profile/background.png', function(err, picture) {
  1167.    if (err) throw err
  1168.    var img = new Image
  1169.    img.onload = () => {
  1170.    ctx.drawImage(img, 0, 0, 500, 500)
  1171.      }
  1172.      img.src = picture
  1173.    })
  1174.  
  1175.                      let url = getvalueof.displayAvatarURL.endsWith(".webp") ? getvalueof.displayAvatarURL.slice(5, -20) + ".png" : getvalueof.displayAvatarURL;
  1176.                      jimp.read(url, (err, ava) => {
  1177.                          if (err) return console.log(err);
  1178.                          ava.getBuffer(jimp.MIME_PNG, (err, buf) => {
  1179.                              if (err) return console.log(err);
  1180.      
  1181.                  //XP
  1182.      ctx.font = '22px Cairo';
  1183.      ctx.fillStyle = '#020202';
  1184.      ctx.fillText(`Total XP : ${Math.floor(userData[z.id].Xp)}`,  110,467);
  1185.                  //MONEY
  1186.      ctx.font = '24px Cairo';
  1187.      ctx.fillStyle = '#020202';
  1188.      ctx.fillText(`Credits : ${Math.floor(userData[z.id].money)}`,  220,360);
  1189.                        //USERNAME
  1190.                    ctx.font = '25px Cairo';
  1191.      ctx.fillStyle = '#020202';
  1192.                        ctx.fillText(`${z.username}`, 215, 170)
  1193.                        //LEVEL
  1194.      ctx.font = '30px Cairo';
  1195.      ctx.textAlign = 'left';
  1196.      ctx.fillStyle = '#020202';
  1197.      ctx.shadowColor = 'rgba(0, 0, 0, 0.4)';
  1198.      ctx.fillText(`${userData[z.id].level}`, 90, 310);
  1199.            //info Box :)
  1200.                        ctx.font = '25px Cairo';
  1201.                        ctx.textAlign = 'left';
  1202.      ctx.fillStyle = '#020202';
  1203.                        ctx.shadowColor = 'rgba(0, 0, 0, 0.4)';
  1204.                        ctx.fillText(`${userData[z.id].text}`,265 , 270)
  1205.                        //LIKE
  1206.                        ctx.font = '25px Cairo';
  1207.                        ctx.textAlign = 'Center';
  1208.                        ctx.fillStyle = '#020202';
  1209.                        ctx.shadowColor = 'rgba(0, 0, 0, 0.4)';
  1210.                        ctx.fillText(`❤${rep[message.author.id].repo}`, 80,395);
  1211.      //AVATAR
  1212.                        let Avatar = Canvas.Image;
  1213.                        let ava = new Avatar;
  1214.                        ava.src = buf;
  1215.                        ctx.beginPath();
  1216.                        ctx.arc(98, 144, 84, 0, Math.PI*2, true);
  1217.                        ctx.closePath();
  1218.                        ctx.clip();
  1219.                        ctx.drawImage(ava, 13, 60, 175, 175);
  1220.  
  1221.    setTimeout(function() {
  1222.      fs.readFile(__dirname + '/images_profile/background.png', function(err, picture) {
  1223.        if (err) throw err
  1224.        var img = new Image
  1225.        img.onload = () => {
  1226.          ctx.drawImage(img, -1, -1, 0, 0)
  1227.        }
  1228.        img.src = picture
  1229.        let inventoryPicture = canvas.toDataURL()
  1230.        let data = inventoryPicture.replace(/^data:image\/\w+;base64,/, "")
  1231.        let buf = new Buffer(data, 'base64')
  1232.        fs.writeFile(`images.png`, buf)
  1233.        message.channel.send(`**:pencil: | Showing your Profile ${message.author.username}**`, {
  1234.          file: `images.png` // Or replace with FileOptions object
  1235.        })
  1236.      })
  1237.    }, 1000)
  1238.  
  1239.    function roundedImage(x, y, width, height, radius) {
  1240.      ctx.beginPath();
  1241.      ctx.moveTo(x + radius, y);
  1242.      ctx.lineTo(x + width - radius, y);
  1243.      ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
  1244.      ctx.lineTo(x + width, y + height - radius);
  1245.      ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
  1246.      ctx.lineTo(x + radius, y + height);
  1247.      ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
  1248.      ctx.lineTo(x, y + radius);
  1249.      ctx.quadraticCurveTo(x, y, x + radius, y);
  1250.      ctx.closePath();
  1251.    }
  1252.  
  1253.    function wrapText(context, text, x, y, maxWidth, lineHeight) {
  1254.  
  1255.      var words = text.split(' '),
  1256.        line = '',
  1257.        lineCount = 0,
  1258.        i,
  1259.        test,
  1260.        metrics;
  1261.  
  1262.      for (i = 0; i < words.length; i++) {
  1263.        test = words[i];
  1264.        metrics = context.measureText(test);
  1265.        while (metrics.width > maxWidth) {
  1266.          // Determine how much of the word will fit
  1267.          test = test.substring(0, test.length - 1);
  1268.          metrics = context.measureText(test);
  1269.        }
  1270.        if (words[i] != test) {
  1271.          words.splice(i + 1, 0, words[i].substr(test.length))
  1272.          words[i] = test;
  1273.        }
  1274.  
  1275.        test = line + words[i] + ' ';
  1276.        metrics = context.measureText(test);
  1277.  
  1278.        if (metrics.width > maxWidth && i > 0) {
  1279.          context.fillText(line, x, y);
  1280.          line = words[i] + ' ';
  1281.          y += lineHeight;
  1282.          lineCount++;
  1283.        } else {
  1284.          line = test;
  1285.        }
  1286.      }
  1287.      ctx.fillText(line, x, y);
  1288.    }
  1289.      })
  1290.      })
  1291.      }
  1292.      if(message.content.startsWith(prefix + 'profile')) {
  1293.    let user = message.author
  1294.     const embed = new Discord.RichEmbed()
  1295.    .setColor(color)
  1296.  .setThumbnail(user.avataraurl)
  1297.  .setTitle(user.username + '‘s Profile')
  1298.  .addField('**Name👥**', user.username)
  1299.  .addField('**Rep❤**', `${rep[user.id].repo}`,true)
  1300.  .addField('**Level**', `${lvl[z.id].level}`,true)
  1301.  .addField('**Credits :credit_card:**', `${Math.floor(userData[z.id].money)}`,true)
  1302.  .addField('**Infoℹ**', `${userData[z.id].text}`)
  1303.     .setFooter('This profile is temporary until finish from working to better one')
  1304.            message.channel.sendEmbed(embed)
  1305.  
  1306.  }
  1307.      });
  1308.  
  1309.  
  1310.  
  1311.  
  1312. client.on('message', message => {
  1313. if (message.author.bot) return null;
  1314. let sender = message.author;
  1315. let msg = message.content.toUpperCase();
  1316. if (!userData[sender.id]) userData[sender.id] = {}
  1317. if (!userData[sender.id].money) userData[sender.id].money = 200;
  1318. if (!userData[sender.id].lastDaily) userData[sender.id].lastDaily = 'Not Collected';
  1319. if (!userData[sender.id].messages) userData[sender.id].messages = 1;
  1320. if (!userData[sender.id].level) userData[sender.id].level = 1;
  1321. if (!userData[sender.id].like) userData[sender.id].like = 1;
  1322. if (!userData[sender.id].text) userData[sender.id].text = `${prefix}setinfo to set.`
  1323.  
  1324. if(message.content.startsWith(prefix + 'credit')) {
  1325. var mentionned = message.mentions.users.first();
  1326. if (!userData[sender.id]) userData[sender.id] = {}
  1327. if (!userData[sender.id].money) userData[sender.id].money = 0;
  1328. fs.writeFile('./userData.json', JSON.stringify(userData), (err) => {
  1329. if (err) console.error(err);
  1330. })
  1331.        
  1332.    var x5bzm;
  1333.      if(mentionned){
  1334.          var x5bzm = mentionned;
  1335.      } else {
  1336.          var x5bzm = message.author;
  1337.          
  1338.      }
  1339.  
  1340.      var mando = message.mentions.users.id;
  1341.      if  (!userData[x5bzm.id]) userData[x5bzm.id] = {}
  1342.      if (!userData[x5bzm.id].money) userData[x5bzm.id].money = 0;
  1343.      message.channel.send("**:credit_card:  | **" + '`' + x5bzm.username + '`' + "** , your credit is :yen: **" + '`' + userData[x5bzm.id].money + '`' + "** credits!**")
  1344. }
  1345.  
  1346.  
  1347. let cont = message.content.slice(prefix.length).split(" ");
  1348. let args = cont.slice(1);
  1349. if(message.content.startsWith(prefix + 'transfer')) {
  1350.          if (!args[0]) {
  1351.            message.channel.send(`**اذا كنت تريد ان Ã˜ÂªÃ˜Â­Ã™Ë†Ã™â€ž الى شخص عن Ã˜Â·Ã˜Â±Ã™Å Ù‚ الامر التالي: ${prefix}credits <الشخص> <المبلغ>**`);
  1352.         return;
  1353.           }
  1354.        // We should also make sure that args[0] is a number
  1355.        if (isNaN(args[0])) {
  1356.            message.channel.send(`**يجب ان Ã˜ÂªÃ™Æ’تب المبلغ : ${prefix}credits <الشخص> <المبلغ>**`);
  1357.            return; // Remember to return if you are sending an error message! So the rest of the code doesn't run.
  1358.              }
  1359.             let defineduser = '';
  1360.             let firstMentioned = message.mentions.users.first();
  1361.             defineduser = (firstMentioned)
  1362.             if (!defineduser) return message.channel.send(`**يجب ان Ã˜ÂªÃ™Æ’تب المبلغ : ${prefix}credits <الشخص> <المبلغ>**`);
  1363.             var mentionned = message.mentions.users.first();
  1364. if (!userData[sender.id]) userData[sender.id] = {}
  1365. if (!userData[sender.id].money) userData[sender.id].money = 200;
  1366. fs.writeFile('./userData.json', JSON.stringify(userData), (err) => {
  1367. if (err) console.error(err);
  1368. })
  1369.       var mando = message.mentions.users.id;
  1370.       if  (!userData[defineduser.id]) userData[defineduser.id] = {}
  1371.       if (!userData[defineduser.id].money) userData[defineduser.id].money = 200;
  1372.       userData[defineduser.id].money += (+args[0]);
  1373.       userData[sender.id].money += (-args[0]);
  1374.       let mariam = message.author.username
  1375. message.channel.send('`' + mentionned.username + '`' + '** الى  **'+ '`' + mariam + '`' + '**  Ã˜ÂªÃ™â€¦ تحويل المبلغ**'+ (args[0]) + '** :dollar: من **')
  1376. }
  1377.  
  1378. if(message.content.startsWith(prefix + 'daily')) {
  1379. if (userData[sender.id].lastDaily != moment().format('6800000')) {
  1380.     userData[sender.id].lastDaily = moment().format('6800000')
  1381.     userData[sender.id].money += 200;
  1382.     message.channel.send(`**${message.author.username} you collect your \`200\` :dollar: daily pounds**`)
  1383. } else {
  1384.     message.channel.send('**your next Daily :moneybag: : ' + moment().endOf('6800000').fromNow()  + '.**')
  1385. }
  1386. }
  1387. fs.writeFile('./userData.json', JSON.stringify(userData), (err) => {
  1388. if (err) console.error(err);
  1389. })
  1390.  
  1391. if(message.content.startsWith(prefix + 'setinfo')) {
  1392. if (!userData[message.author.id].text) userData[message.author.id].text = 'معلومات عني:';
  1393. var mard = userData[message.author.id].text
  1394. let args = message.content.split(' ').slice(1).join(' ');
  1395. if (!args) return message.channel.send('**عليك كتابه المعلومات بعد الامر التي تريد ان تغيره**')
  1396. userData[message.author.id].text = args ;
  1397. message.channel.send(':ballot_box_with_check:**تم تغير معلوماتك بنجاح**')
  1398. }
  1399. }
  1400. )
  1401.  
  1402. client.login("")
  1403. })
Add Comment
Please, Sign In to add comment