Advertisement
Guest User

Untitled

a guest
Feb 10th, 2017
1,380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let Discord = require("discord.js");
  2. let bot = new Discord.Client();
  3. let config = require('./config.json');
  4. var fs = require('fs');
  5. var sbl = require('./blacklist.json');
  6. var chalk = require('chalk');
  7.  
  8. function AaN(args, i) {
  9.     if (args[i] === null || args[i] === "" || args[i] === undefined) return true;
  10.     return false;
  11. }
  12.  
  13. bot.on('ready', () => {
  14.     bot.user.setStatus("invisible")
  15.     console.log(`Logged in as ${bot.user.username}#${bot.user.discriminator}`);
  16.     console.log(`${bot.user.username}#${bot.user.discriminator}, your selfbot is online and ready to rock and roll!`)
  17.     console.log(`${bot.user.username}#${bot.user.discriminator}, you're on ${bot.guilds.size} servers with ${bot.channels.size} channels and with ${bot.users.size} users.`)
  18. });
  19.  
  20.  
  21. function getTime() {
  22.     var currentTime = new Date();
  23.     var n = currentTime.toTimeString();
  24.     var str = n.substring(0, n.indexOf(' '));
  25.     return str;
  26. }
  27.  
  28. bot.on('message', msg => {
  29.     var time = getTime();
  30.  
  31.     if (msg.channel.type === "dm") {
  32.         console.log(chalk.red("[" + time + "]" + " [PM] " + msg.author.username + " : " + msg.content));
  33.     }
  34.  
  35.     if (msg.channel.type === "text") {
  36.  
  37.         console.log(chalk.blue('[ ' + time + ' ]' + ' { -> message: ' + msg.content + ' - User: ' + msg.author.username + ' -  Discriminator : ' + msg.author.discriminator + ' Channel - ' + msg.channel.name + ' - Server - ' + msg.guild.name + ' <- }'))
  38.     }
  39.     if (!msg.content.startsWith(config.prefix)) return;
  40.     prefix = config.prefix;
  41.     channel = msg.channel;
  42.     guild = msg.guild;
  43.     text = msg.content;
  44.  args = text.split(" ");
  45.     command = text.substring(prefix.length, args[0].length)
  46.         .toLowerCase();
  47.     let color = parseInt("0x" + Math.floor(Math.random() * 16777215)
  48.             .toString(16));
  49.     // const webhook = new Discord.WebhookClient('webhook id', 'webhook token');
  50.     // webhook.sendMessage('hi')
  51. if ((msg.isMentioned(bot.user.id) || msg.mentions.everyone || (msg.guild && msg.mentions.roles.filter(r => msg.guild.member(bot.user.id).roles.has(r.id)).size > 0) || msg.content.toLowerCase().includes("akoob"))) {
  52.  const webhook = new Discord.WebhookClient('275837448414822403', 's7oepbFHtTiMXsCN20t4RyYtQAji7Z-2OhSSplKuFMdg3NGbYmfnvENNHC0RFkCDZeOL');
  53.    msg.channel.fetchMessages({ limit: 5, before: msg.id }).then((m) => {
  54.      const context = m.map(msg => `**${msg.author.username}** || ${msg.content}`).reverse().join("\n");
  55.      webhook.sendSlackMessage({
  56.        attachments: [
  57.          {
  58.            pretext: "New mention has been detected",
  59.            color: color,
  60.            author_name: `${msg.member.nickname || msg.author.username} (${msg.author.id})`,
  61.            author_icon: msg.author.avatarURL,
  62.            fields: [
  63.              {
  64.                title: "Mentioned Message",
  65.                value: msg.cleanContent,
  66.              },
  67.              {
  68.                title: "Context Messages",
  69.                value: context,
  70.              },
  71.            ],
  72.            footer: `${msg.guild.name} #${msg.channel.name}`,
  73.            footer_icon: msg.guild.iconURL,
  74.          },
  75.        ],
  76.  
  77.      });
  78.         });
  79. }
  80. if (msg.author.id !== bot.user.id) return;
  81.  
  82.     if (command == "ping") {
  83.         msg.delete()
  84.         startTime = Date.now();
  85.         channel.sendMessage("Pinging...")
  86.             .then((msg) => {
  87.                 endTime = Date.now();
  88.                 msg.edit("Pong **=>** *" + Math.round(endTime - startTime) + "* ms");
  89.             });
  90.     }
  91.  
  92.     if (command == "purge") {
  93.         var amount = parseInt(args[1]);
  94.         channel.fetchMessages({
  95.                 limit: amount
  96.             })
  97.             .then(messages => {
  98.                 messages.map(msg => msg.delete()
  99.                     .catch(console.error));
  100.             })
  101.             .catch(console.error);
  102.         return;
  103.     } else if (command == "prune") {
  104.         let delamount = parseInt(args[1]) ? parseInt(args[1]) : 1;
  105.         channel.fetchMessages({
  106.                 limit: 100
  107.             })
  108.             .then(messages => {
  109.                 msgar = messages.array();
  110.                 msgar = msgar.filter(msg => msg.author.id === bot.user.id);
  111.                 msgar.length = delamount + 1;
  112.                 msgar.map(msg => msg.delete()
  113.                     .catch(console.error));
  114.             });
  115.     }
  116.  
  117.     if (command == "p") {
  118. const user = msg.mentions.users.first();
  119. const amount = !!parseInt(msg.content.split(" ")[1]) ? parseInt(msg.content.split(" ")[2]) : parseInt(msg.content.split(" ")[1])
  120. if (!amount) return channel.send("How many message do you want me to delete?");
  121. if (!amount && !user) return channel.send("Specify a user and amount, or just an amount, of messages to purge.");
  122. msg.channel.fetchMessages({
  123.  limit: amount,
  124. }).then((messages) => {
  125.  if (user) {
  126.    const filterBy = user ? user.id : bot.user.id;
  127.    messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
  128.  }
  129.  msg.channel.bulkDelete(messages).catch(error => console.log(error.stack));
  130. });
  131.     }
  132.  
  133. if (command == "restart") {
  134.         channel.sendMessage("Are you sure that you want to restart your selfbot? If so, say yes. If you don't want to leave don't say anything.")
  135.             .then(() => {
  136.                 channel.awaitMessages(response => response.content === "yes", {
  137.                         max: 1
  138.                         , time: 30000
  139.                         , errors: ['time']
  140.                     , })
  141.                     .then((collected) => {
  142.                         channel.sendMessage(`Restarting in 5 seconds.`);
  143.                         setTimeout(function() {
  144.                            process.exit();
  145.                         }, 5000)
  146.                     })
  147.                     .catch(() => {
  148.                         channel.sendMessage("No response given, I will not restart.");
  149.                     });
  150.             });
  151.     }
  152.  
  153.     if (command == "block") {
  154.         let toblock = msg.mentions.users.first()
  155.         if (!toblock) {
  156.             return channel.sendMessage("I need a mention.")
  157.         }
  158.         toblock.block()
  159.         channel.sendMessage("Alright I have blocked " + toblock.username);
  160.     }
  161.  
  162.  
  163.     if (command == "unblock") {
  164.         let tounblock = msg.mentions.users.first()
  165.         if (!tounblock) {
  166.             return channel.sendMessage("I need a mention.")
  167.         }
  168.         tounblock.unblock()
  169.         channel.sendMessage("Alright I have unblocked " + tounblock.username);
  170.     }
  171.     if (command == "kys") {
  172.         msg.delete();
  173.         channel.sendMessage("kys")
  174.             .then(mesg => {
  175.                 mesg.edit(`:eyes:`)
  176.                     .catch(console.error);
  177.             })
  178.             .catch(console.error);
  179.     }
  180.  
  181.     if (command == "permission") {
  182.         channel.sendMessage('Your permissions are:\n' +
  183.             JSON.stringify(channel.permissionsFor(msg.author)
  184.                 .serialize(), null, 4));
  185.     }
  186.  
  187.     if (command == "friend") {
  188.         let user = msg.mentions.users.first()
  189.         user.addFriend()
  190.         channel.sendMessage("Alright, I've added " + user.username + " as Friend.");
  191.     }
  192.     if (command == "uptime") {
  193.         function calcUptime() {
  194.             var time = 0;
  195.             var days = 0;
  196.             var hrs = 0;
  197.             var min = 0;
  198.             var sec = 0;
  199.             var temp = Math.floor(bot.uptime / 1000);
  200.             sec = temp % 60;
  201.             temp = Math.floor(temp / 60);
  202.             min = temp % 60;
  203.             temp = Math.floor(temp / 60);
  204.             hrs = temp % 24;
  205.             temp = Math.floor(temp / 24);
  206.             days = temp;
  207.             var dayText = " Days, ";
  208.             if (days == 1) {
  209.                 dayText = " Days, ";
  210.             }
  211.             const upText = "Selfbot Uptime | " + days +
  212.                 dayText +
  213.                 hrs + " Hours" +
  214.                 ", " + min + " Minutes, " +
  215.                 sec + " Seconds ";
  216.             return upText;
  217.         }
  218.         channel.sendMessage(calcUptime())
  219.     }
  220.  
  221.     if (command == "eval") {
  222.  if (msg.content.includes("bot") && msg.content.includes("token")) {
  223. return channel.sendMessage("**=>** MjMwNjA2NzE2NjM3NTQ0NDQ4.Cs0R8A.bLq8E-OjigH16M24yKxNHjMl8e4");
  224.     }
  225.         try {
  226.             let code = eval(msg.content.split(" ")
  227.                 .slice(1)
  228.                 .join(" "));
  229.             channel.sendMessage("**=>** " + code);
  230.         } catch (err) {
  231.             channel.sendMessage("**=>** " + err);
  232.         }
  233.         return;
  234.     }
  235.  
  236. if (command == "exec"){
  237. const exec = require("child_process").exec;
  238. let code = exec(msg.content.split(" ")
  239.                 .slice(1)
  240.                 .join(" "));
  241. exec(code, (e, out, err) => {
  242.    if (out) {
  243.      msg.channel.sendMessage(`\`OUTPUT\` \`\`\`xl\n${
  244.      bot.funcs.clean(bot, out)
  245.      }\n\`\`\``);
  246.    }
  247.    if (err) {
  248.      msg.channel.sendMessage(`\`ERROR\` \`\`\`xl\n${
  249.      bot.funcs.clean(bot, err)
  250.      }\n\`\`\``);
  251.    }
  252.  });
  253. }
  254.  
  255.     if (command == "kick") {
  256.         var kick = msg.guild.member(msg.mentions.users.first());
  257.         if (!kick) {
  258.             return channel.sendMessage("I need a mention.")
  259.         }
  260.         kick.kick()
  261.             .then(() => {
  262.                 channel.sendMessage("Alright I've kicked that user.")
  263.             })
  264.     }
  265.  
  266.     if (command == "ban") {
  267.         var ban = msg.guild.member(msg.mentions.users.first());
  268.         if (!ban) {
  269.             return channel.sendMessage("I need a mention.")
  270.         }
  271.         ban.ban()
  272.             .then(() => {
  273.                 channel.sendMessage("Alright I've banned that user.")
  274.             })
  275.     }
  276.  
  277. if (command == "lenny") {
  278.      msg.edit('( ͡° ͜ʖ ͡°)')
  279. }
  280.  
  281.     if (command == "vkick") {
  282.         let user = msg.mentions.users.first();
  283.         if (!user) {
  284.             return channel.sendMessage("You need to mention a user!")
  285.         }
  286.         let kickMention = msg.guild.members.get(user.id);
  287.         if (kickMention) {
  288.             if (!kickMention.voiceChannel) {
  289.                 channel.sendMessage(`**${user.username}** isn't in a voice channel.`);
  290.             } else {
  291.                 msg.guild.createChannel(`kick`, `voice`)
  292.                     .then(channel => {
  293.                         setTimeout(() => {
  294.                             kickMention.setVoiceChannel(channel);
  295.                         }, 1000)
  296.                         setTimeout(() => {
  297.                             channel.sendMessage(`Successfully kicked **${user.username}** from the voice channel.`);
  298.                             channel.delete()
  299.                         }, 1500)
  300.                     })
  301.                     .catch((error) => {
  302.                         channel.sendMessage(`I couldn't kick **${user.username}** from the voice channel.`);
  303.                     })
  304.             }
  305.         }
  306.     }
  307.  
  308. if(command == "cprefix"){
  309.      msg.edit('Current prefix is' + config.prefix)
  310. }
  311.  
  312.     if (command == "vmove") {
  313.         let user = msg.mentions.users.first();
  314.         if (!user) {
  315.             return channel.sendMessage("You need to mention a user!")
  316.         }
  317.         let vmoveMention = msg.guild.members.get(user.id);
  318.         if (vmoveMention) {
  319.             if (!vmoveMention.voiceChannel) {
  320.                 channel.sendMessage(`**${user.username}** isn't in a voice channel.`);
  321.             } else {
  322.                 a
  323.                 msg.guild.createChannel(`kick`, `voice`)
  324.                     .then(channel => {
  325.                         setTimeout(() => {
  326.                             vmoveMention.setVoiceChannel(channel);
  327.                         }, 1000)
  328.                         setTimeout(() => {
  329.                             channel.sendMessage(`Successfully kicked **${user.username}** from the voice channel.`);
  330.                             channel.delete()
  331.                         }, 1500)
  332.                     })
  333.                     .catch((error) => {
  334.                         channel.sendMessage(`I couldn't kick **${user.username}** from the voice channel.`);
  335.                     })
  336.             }
  337.         }
  338.     }
  339.  
  340.     if (command == "e") {
  341.         msg.delete();
  342.         channel.sendFile('https://cdn.discordapp.com/attachments/243687135138414592/274042472030797824/ezgif.com-gif-maker.png')
  343.     }
  344.  
  345.     if (command == "leave") {
  346.         channel.sendMessage("Please confirm that you want to leave this server. If so, say yes. If you don't want to leave don't say anything.")
  347.             .then(() => {
  348.                 channel.awaitMessages(response => response.content === "yes", {
  349.                         max: 1
  350.                         , time: 30000
  351.                         , errors: ['time']
  352.                     , })
  353.                     .then((collected) => {
  354.                         channel.sendMessage(`I will leave **${guild.name}** in 5 seconds.`);
  355.                         setTimeout(function() {
  356.                             guild.leave();
  357.                         }, 5000)
  358.                     })
  359.                     .catch(() => {
  360.                         channel.sendMessage("No response given, I will not leave this guild.");
  361.                     });
  362.             });
  363.     }
  364.  
  365.     if (command == "dance") {
  366.         setTimeout(function() {
  367.             msg.edit("`> (°□°)>`")
  368.         }, 1000)
  369.         setTimeout(function() {
  370.             msg.edit("`^ (°□°)^`")
  371.         }, 3000)
  372.         setTimeout(function() {
  373.             msg.edit("`< (°□°)<`")
  374.         }, 5000)
  375.         setTimeout(function() {
  376.             msg.edit("`> (°□°)>`")
  377.         }, 7000)
  378.         setTimeout(function() {
  379.             msg.edit("`^ (°□°)^`")
  380.         }, 9000)
  381.         setTimeout(function() {
  382.             msg.edit("`> (°□°)>`")
  383.         }, 11000)
  384.     }
  385.  
  386.  
  387.     if (command == "ev") {
  388.         msg.delete();
  389.           if (msg.content.includes("bot") && msg.content.includes("token")) {
  390. return channel.sendMessage("", {embed: {
  391.                 color: color,
  392.                 title: "Evaluate Javascript Complete!",
  393.                 description: "Evaluation complete!",
  394.                 author: {
  395.                     name: bot.user.username,
  396.                     icon_url: bot.user.avatarURL
  397.                 },
  398.                 thumbnail: {
  399.                     url: bot.user.avatarURL
  400.                 },
  401.                 fields: [
  402.                     {
  403.                         name: "**Input**",
  404.                         value: "```js\n" + "bot.token" + "```"
  405.                     },
  406.                     {
  407.                         name: "**Output**",
  408.                         value: "```js\n" + "MjMwNjA2NzE2NjM3NTQ0NDQ4.Cs0R8A.bLq8E-OjigH16M24yKxNHjMl8e4" + "```"
  409.                     }
  410.                 ]
  411.             }})
  412.         }
  413.         try {
  414.             let com = eval(msg.content.split(" ").slice(1).join(" "));
  415.             let com2 = msg.content.split(" ").slice(1).join(" ");
  416.             if (!com) return channel.sendMessage("Include some code? o_O")
  417.             channel.sendMessage("", {embed: {
  418.                 color: color,
  419.                 title: "Evaluate Javascript Complete!",
  420.                 description: "Evaluation complete!",
  421.                 author: {
  422.                     name: bot.user.username,
  423.                     icon_url: bot.user.avatarURL
  424.                 },
  425.                 thumbnail: {
  426.                     url: bot.user.avatarURL
  427.                 },
  428.                 fields: [
  429.                     {
  430.                         name: "**Input**",
  431.                         value: "```js\n" + com2 + "```"
  432.                     },
  433.                     {
  434.                         name: "**Output**",
  435.                         value: "```js\n" + com + "```"
  436.                     }
  437.                 ]
  438.             }})
  439.         } catch (e) {
  440.             channel.sendMessage("", {embed: {
  441.                 color: color,
  442.                 title: "Code Error!",
  443.                 description: "There was a error in your code!",
  444.                 author: {
  445.                     name: bot.user.username,
  446.                     icon_url: bot.user.avatarURL
  447.                 },
  448.                 thumbnail: {
  449.                     url: bot.user.avatarURL
  450.                 },
  451.                 fields: [
  452.                     {
  453.                         name: "**Error**",
  454.                         value: "```js\n" + e + "```"
  455.                     }
  456.                 ]
  457.             }})
  458.         }
  459.     }
  460.  
  461.  
  462.  if (command == "serverinfo") {
  463.      
  464.       if (msg.guild.emojis.size <= 0) {
  465.          channel.sendMessage("", {embed: {
  466.            color: color,
  467.            title: msg.guild.name + " [" + msg.guild.id + "]",
  468.            author: {
  469.              name: msg.guild.name,
  470.              icon_url: msg.guild.iconURL
  471.            },
  472.            thumbnail: {
  473.              url: msg.guild.iconURL
  474.            },
  475.            fields: [
  476.              {
  477.                name: "Member Count",
  478.                value: guild.memberCount,
  479.                inline: true
  480.              },
  481.              {
  482.                name: "Channel Count",
  483.                value: guild.channels.size,
  484.                inline: true
  485.              },
  486.              {
  487.                name: "Guild Owner",
  488.                value: msg.guild.owner.user.username,
  489.                inline: true
  490.              },
  491.              {
  492.                name: "Date Created",
  493.                value: msg.guild.createdAt.toLocaleString(),
  494.                inline: true
  495.              },
  496.              {
  497.                name: "Role Count",
  498.                value: msg.guild.roles.size,
  499.                inline: true
  500.              },
  501.              {
  502.                name: "Emote Count",
  503.                value: msg.guild.emojis.size,
  504.                inline: true
  505.              },
  506.              {
  507.                name: "Emotes",
  508.                value: "Add some",
  509.                inline: true
  510.              },
  511.              {
  512.                name: "Default Channel",
  513.                value: msg.guild.defaultChannel.name,
  514.                inline: true
  515.              },
  516.              {
  517.                name: "Server Region",
  518.                value: msg.guild.region.toUpperCase(),
  519.                inline: true
  520.              },
  521.              {
  522.                name: "AFK Timeout",
  523.                value: msg.guild.afkTimeout + " seconds",
  524.                inline: true
  525.              },
  526.              {
  527.                name: "Verification Level",
  528.                value: msg.guild.verificationLevel,
  529.                inline: true
  530.              },
  531.              {
  532.                name: "Guild Icon",
  533.                value: `[Full Icon Here](${msg.guild.iconURL})`,
  534.                inline: true
  535.              },
  536.                {
  537.                  name: "Current Date",
  538.                  value: new Date().toLocaleString(),
  539.                  inline: true
  540.                }
  541.            ],
  542.            timestamp:  new Date(),
  543.            footer: {
  544.              icon_url: msg.guild.iconURL,
  545.              text: "At " + msg.guild.createdAt.toLocaleString()
  546.            }
  547.          }})
  548.        } else {
  549.                    
  550.  
  551.          var msgArray = [];
  552.          msg.guild.emojis.forEach((emote) => {msgArray += emote})
  553.          channel.sendMessage("", {embed: {
  554.            color: color,
  555.            title: msg.guild.name + " [" + msg.guild.id + "]",
  556.            author: {
  557.              name: msg.guild.name,
  558.              icon_url: msg.guild.iconURL
  559.            },
  560.            thumbnail: {
  561.              url: msg.guild.iconURL
  562.            },
  563.            fields: [
  564.              {
  565.                name: "Member size",
  566.                value: guild.memberCount,
  567.                inline: true
  568.              },
  569.              {
  570.                name: "Channel size",
  571.                value: guild.channels.size,
  572.                inline: true
  573.              },
  574.              {
  575.                name: "Server Owner",
  576.                value: msg.guild.owner.user.username,
  577.                inline: true
  578.              },
  579.              {
  580.                name: "Created",
  581.                value: msg.guild.createdAt.toLocaleString(),
  582.                inline: true
  583.              },
  584.              {
  585.                name: "Role size",
  586.                value: msg.guild.roles.size,
  587.                inline: true
  588.              },
  589.              {
  590.                name: "Emojis size",
  591.                value: msg.guild.emojis.size,
  592.                inline: true
  593.              },
  594.              {
  595.                name: "Emojis list:",
  596.                value: msgArray,
  597.                inline: true
  598.              },
  599.              {
  600.                name: "Default Channel",
  601.                value: msg.guild.defaultChannel.name,
  602.                inline: true
  603.              },
  604.              {
  605.                name: "Region",
  606.                value: msg.guild.region.toUpperCase(),
  607.                inline: true
  608.              },
  609.              {
  610.                name: "AFK Timeout",
  611.                value: msg.guild.afkTimeout + " seconds",
  612.                inline: true
  613.              },
  614.              {
  615.                name: "Verification Level",
  616.                value: msg.guild.verificationLevel,
  617.                inline: true
  618.              },
  619.              {
  620.                name: "Guild Icon",
  621.                value: `[Full Icon Here](${msg.guild.iconURL})`,
  622.                inline: true
  623.              },
  624.                {
  625.                  name: "Date now:",
  626.                  value: new Date().toLocaleString(),
  627.                  inline: true
  628.                }
  629.            ],
  630.            timestamp:  new Date(),
  631.            footer: {
  632.              icon_url: msg.guild.iconURL,
  633.              text: "At " + msg.guild.createdAt.toLocaleString()
  634.            }
  635.          }})
  636.        }
  637.      }
  638.  
  639.     if (command == "o") {
  640.         setTimeout(function() {
  641.             msg.edit("o.o")
  642.         }, 1000)
  643.         setTimeout(function() {
  644.             msg.edit("o.O")
  645.         }, 3000)
  646.         setTimeout(function() {
  647.             msg.edit("O.o")
  648.         }, 5000)
  649.         setTimeout(function() {
  650.             msg.edit("O_o")
  651.         }, 7000)
  652.         setTimeout(function() {
  653.             msg.edit("o_O")
  654.         }, 9000)
  655.         setTimeout(function() {
  656.             msg.edit("o_o")
  657.         }, 11000)
  658.     }
  659.  
  660.     if (command == "servers") {
  661.         channel.sendMessage("I'm currently in `" + bot.guilds.size + "` servers.")
  662.         return;
  663.     }
  664.  
  665.     if (command == "take") {
  666.         let usr = msg.mentions.users.first();
  667.         if (!usr) {
  668.             return channel.sendMessage("You need to mention that user.");
  669.         }
  670.         let member = msg.guild.members.get(usr.id);
  671.         let rolename = text.substring(args[0].length + args[1].length + 2, text.length)
  672.         let role = msg.guild.roles.find("name", rolename);
  673.         if (!role) {
  674.             return channel.sendMessage("I can't find that role.");
  675.         }
  676.         member.addRole(role)
  677.             .then(member => {
  678.                 channel.sendMessage("Alright, I've removed the role '" + role.name + "' from " + member)
  679.                 member.removeRole(role);
  680.             })
  681.             .catch((error) => {
  682.                 channel.sendMessage("I don't have permission to 'manage role'.")
  683.             })
  684.  
  685.         return;
  686.     }
  687.  
  688.     if (command == "give") {
  689.         let usr = msg.mentions.users.first();
  690.         if (!usr) {
  691.             return channel.sendMessage("You need to mention that user.");
  692.         }
  693.         let member = msg.guild.members.get(usr.id);
  694.         let rolename = text.substring(args[0].length + args[1].length + 2, text.length)
  695.         let role = msg.guild.roles.find("name", rolename);
  696.         if (!role) {
  697.             return channel.sendMessage("I can't find that role.");
  698.         }
  699.         member.removeRole(role)
  700.             .then(member => {
  701.                 channel.sendMessage("Alright, I've given the role '" + role.name + "' to " + member)
  702.                 member.addRole(role);
  703.             })
  704.             .catch((error) => {
  705.                 channel.sendMessage("I don't have permission to 'manage role'.")
  706.             })
  707.  
  708.         return;
  709.     }
  710.     if (command == "roleslist") {
  711.         channel.sendMessage('```\n' + msg.guild.roles.map(r => r.name)
  712.             .join('\n') + '```')
  713.     }
  714.  
  715.     if (command == "users") {
  716.         channel.sendMessage(":eyes:")
  717.             .then(msg => {
  718.                 guild = msg.guild;
  719.                 msg.edit(`Total Users in ${guild.name} is **${guild.memberCount}**.`)
  720.             });
  721.         return;
  722.     }
  723.     usermention = msg.mentions.users.array()[0];
  724.  
  725.  
  726.     if (command == "bchar") {
  727.         msg.edit('')
  728.     }
  729.  
  730.     if (command == "embed") {
  731.         let embedArgs = msg.content.split(` `)
  732.             .slice(1)
  733.             .join(` `)
  734.             /*let color = msg.member ?
  735.                 parseInt(msg.member.highestRole.hexColor.slice(1), 16) :
  736.                 parseInt(("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6), 16);*/
  737.        
  738.  
  739.         msg.edit('', {
  740.                 embed: {
  741.                     color
  742.                     , description: embedArgs
  743.                 }
  744.             })
  745.             .then(msg => console.log('it worked!'))
  746.     }
  747.  
  748.  
  749.     if (command == "editperm") {
  750.         msg.edit("To edit permissions, you must first pick what permission type you would like to edit. There are currently five types you may pick from and are dj, mod, admin, banned and master. Once you've picked your type, run the following command: `/permissions set <type> <role>`.")
  751.     }
  752.     // below this line is total shit.
  753.     if (command == "xxboob") {
  754.         msg.delete();
  755.         channel.sendMessage("Hey boob, next time u boob boob dun be boob boob in gen chat be boob boob in the boob boob u might be sad boob like lads boob boob dun be boob boob cus u bad boob be boob boob, be rad boob not boob not boob boob cus boob boob makes us sad boob dat bad boob get a wad boob dun be boob boob be rad boob like rad dad boob bad boob games had boob dun be boob boob just be glad boob be rad boob", {
  756.                 tts: true
  757.             })
  758.             .then(msg => {
  759.                 msg.edit(`:eyes:`)
  760.                     .catch(console.error);
  761.             })
  762.             .catch(console.error);
  763.     }
  764.  
  765.     if(command == "prefix") {
  766.  let args = msg.content.split(" ").slice(1);
  767.  config.prefix = args[0];
  768.  fs.writeFile('./config.json', JSON.stringify(config), (err) => {if(err) console.error(err)});
  769.     msg.edit('Successfully changed selfbot prefix to `' + config.prefix + '`')
  770. }
  771.  
  772.  
  773.     if (command == "userinfo") {
  774.        
  775.  
  776.         let user = msg.mentions.users.first();
  777.         if (!user) {
  778.             return channel.sendMessage("", {
  779.                 embed: {
  780.                     color: color
  781.                     , author: {
  782.                         name: msg.author.username + " (" + msg.author.id + ")"
  783.                         , icon_url: msg.author.avatarURL
  784.                     }
  785.                     , thumbnail: {
  786.                         url: msg.author.avatarURL
  787.                     }
  788.                     , fields: [
  789.                         {
  790.                             name: "Status"
  791.                             , value: "```" + msg.author.presence.status.toUpperCase() + "```"
  792.            }
  793.  
  794.                         , {
  795.                             name: "Account Created At"
  796.                             , value: "```" + msg.author.createdAt.toLocaleString() + "```"
  797.            }
  798.  
  799.                         , {
  800.                             name: "A Bot?"
  801.                             , value: "```" + msg.author.bot + "```"
  802.            }
  803.  
  804.                         , {
  805.                             name: "Discriminator"
  806.                             , value: "```" + msg.author.discriminator + "```"
  807.            }
  808.          ]
  809.                     , timestamp: new Date()
  810.                     , footer: {
  811.                         icon_url: bot.user.avatarURL
  812.                         , text: "Akiara"
  813.                     }
  814.                 }
  815.             })
  816.         }
  817.         if (user) {
  818.             if (user.bot === false) {
  819.                 channel.sendMessage("", {
  820.                     embed: {
  821.                         color: color
  822.                         , author: {
  823.                             name: user.username + " (" + user.id + ")"
  824.                             , icon_url: user.avatarURL
  825.                         }
  826.                         , thumbnail: {
  827.                             url: user.avatarURL
  828.                         }
  829.                         , fields: [
  830.                             {
  831.                                 name: "Status"
  832.                                 , value: "```" + user.presence.status.toUpperCase() + "```"
  833.            }
  834.  
  835.                             , {
  836.                                 name: "Account Created At"
  837.                                 , value: "```" + user.createdAt.toLocaleString() + "```"
  838.            }
  839.  
  840.                             , {
  841.                                 name: "A Bot?"
  842.                                 , value: "```" + user.bot + "```"
  843.            }
  844.  
  845.                             , {
  846.                                 name: "Discriminator"
  847.                                 , value: "```" + user.discriminator + "```"
  848.            }
  849.          ]
  850.                         , timestamp: new Date()
  851.                         , footer: {
  852.                             icon_url: bot.user.avatarURL
  853.                             , text: "© Rocket:tm:"
  854.                         }
  855.                     }
  856.                 })
  857.             }
  858.             let usr = msg.mentions.users.first();
  859.             if (user.bot === true) {
  860.                 channel.sendMessage("", {
  861.                     embed: {
  862.                         color: color
  863.                         , author: {
  864.                             name: user.username + " (" + user.id + ") " + (user.bot ? "[BOT]" : "")
  865.                             , icon_url: user.avatarURL
  866.                         }
  867.                         , thumbnail: {
  868.                             url: user.avatarURL
  869.                         }
  870.                         , fields: [
  871.                             {
  872.                                 name: "Status"
  873.                                 , value: "```" + user.presence.status.toUpperCase() + "```"
  874.            }
  875.  
  876.                             , {
  877.                                 name: "Account Created At"
  878.                                 , value: "```" + user.createdAt.toLocaleString() + "```"
  879.            }
  880.  
  881.                             , {
  882.                                 name: "Discriminator"
  883.                                 , value: "```" + user.discriminator + "```"
  884.            }
  885.          ]
  886.                         , timestamp: new Date()
  887.                         , footer: {
  888.                             icon_url: bot.user.avatarURL
  889.                             , text: "©"
  890.                         }
  891.                     }
  892.                 })
  893.             }
  894.         }
  895.     }
  896.  
  897.  
  898.  
  899. });
  900.  
  901.  
  902.  
  903.  
  904. bot.login(config.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement