SHARE
TWEET

Untitled

a guest Oct 16th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const settings = require("./settings.json");
  3. const moment = require("moment");
  4.  
  5. var client = new Discord.Client();
  6.  
  7. var fortunes = [
  8.     "`Yes`",
  9.     "`No`",
  10.     "`Maybe`",
  11.     "`Ask again`",
  12.     "`Sometimes`",
  13.     "`Okay`",
  14.     "`HELL NO`",
  15.     "`FUCK YEAH`",
  16.     "`no no no`"
  17. ];
  18.  
  19. client.on("ready", function() {
  20.     var clientonmessage = `
  21. ------------------------------------------------------
  22. > Logging in...
  23. ------------------------------------------------------
  24. Logged in as ${client.user.tag}
  25. Working on ${client.guilds.size} servers!
  26. ${client.channels.size} channels and ${client.users.size} users cached!
  27. I am logged in and ready to roll!
  28. LET'S GO!
  29. ------------------------------------------------------
  30. ----------Bot created by Blue Malgeran#3106-----------
  31. ------------------------------------------------------
  32. -----------------Bot's commands logs------------------`
  33.  
  34.     console.log(clientonmessage);
  35.     //The default game.
  36.     //client.user.setActivity(`${client.guilds.size} servers | ${settings.botPREFIX}help`, { type: settings.statusTYPE });
  37.  
  38.     // Cool interval loop for the bot's game.
  39.     let statusArray = [
  40.         `${settings.botPREFIX}help | ${client.guilds.size} servers!`,
  41.         `${settings.botPREFIX}help | ${client.channels.size} channels!`,
  42.         `${settings.botPREFIX}help | ${client.users.size} users!`
  43.     ];
  44.  
  45.     setInterval(function() {
  46.         client.user.setActivity(`${statusArray[~~(Math.random() * statusArray.length)]}`, { type: settings.statusTYPE });
  47.     }, 100000);
  48. });
  49.  
  50. // Logs of the bot joined a server and changed the game of the bot
  51. client.on("guildCreate", guild => {
  52.     const logsServerJoin = client.channels.get(settings.logsChannelID);
  53.     console.log(`The bot just joined to ${guild.name}, Owned by ${guild.owner.user.tag}`);
  54.     logsServerJoin.send(`The bot just joined to ${guild.name}, Owned by ${guild.owner.user.tag}`);
  55.  
  56.     var guildMSG = guild.channels.find('name', 'general');
  57.  
  58.     if (guildMSG) {
  59.         guildMSG.send(`
  60. Hello there! My original name is \`NotABot\`!\n\
  61. This bot created by **Blue Malgeran#3106**\n\
  62. For more info type \`${settings.botPREFIX}help\`!\n\
  63. \`NotABot - Official Server:\` https://discord.gg/KugMg6K`);
  64.     } else {
  65.         return;
  66.     }
  67. });
  68.  
  69. // Logs of the bot leaves a server and changed the game of the bot
  70. client.on("guildDelete", guild => {
  71.     const logsServerLeave = client.channels.get(settings.logsChannelID);
  72.     console.log(`The bot has been left ${guild.name}, Owned by ${guild.owner.user.tag}`);
  73.     logsServerLeave.send(`The bot has been left ${guild.name}, Owned by ${guild.owner.user.tag}`);
  74. });
  75.  
  76. // Message function
  77. client.on("message", async message => {
  78.     if (message.author.equals(client.user)) return;
  79.  
  80.     if (!message.content.startsWith(settings.botPREFIX)) return;
  81.  
  82.     if (message.author.bot) return;
  83.  
  84.     const logsCommands = client.channels.get(settings.logsChannelID);
  85.  
  86.     //Disables commands in a private chat
  87.     if  (message.channel.type == "dm") {
  88.         console.log(`${message.author.tag} tried to use a command in DM!`);
  89.         return logsCommands.send(`${message.author.tag} tried to use a command in DM!`);
  90.     }
  91.     //Users blacklist
  92.     if (message.author.id == "") {
  93.         console.log(`[BlackList] ${message.author.tag} tried to use a command!`);
  94.         return logsCommands.send(`[BlackList] ${message.author.tag} tried to use a command!`);
  95.     }
  96.  
  97.     //Channels blacklist
  98.     if (message.channel.id == "") return;
  99.  
  100.     //Servers blacklist
  101.     if (message.guild.id == "") return;
  102.  
  103.     var args = message.content.substring(settings.botPREFIX.length).split(" ");
  104.     // Bot's commands from here.
  105.     switch (args[0]) {
  106.         case "info":
  107.         console.log(`${message.author.tag} used the ${settings.botPREFIX}info command!`);
  108.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}info command!`);
  109.  
  110.         message.channel.send({embed: {
  111.             color: 3447003,
  112.             title: "Info:",
  113.             description: "This is the info about the bot",
  114.             fields: [{
  115.                 name: "Created by:",
  116.                 value: "This bot created by [Blue Malgeran](http://BlueMalgeran.com)"
  117.               },
  118.               {
  119.                 name: "Made with:",
  120.                 value: "This bot made with [Discord.JS](http://discord.js.org)"
  121.               },
  122.               {
  123.                 name: "Contact me:",
  124.                 value: "_**Blue Malgeran#3106**_"
  125.               },
  126.               {
  127.                 name: "Social Media",
  128.                 value: "[Twitter](https://twitter.com/BlueMalgeran) | [Steam](http://steamcommunity.com/id/BlueMalgeran/) | [GitHub](https://github.com/BlueMalgeran)"
  129.               },
  130.               {
  131.                 name: "Invite the bot here",
  132.                 value: "[:robot:](https://discordapp.com/oauth2/authorize?client_id=" + client.user.id + "&scope=bot&permissions=0)"
  133.               }
  134.             ],
  135.             timestamp: new Date(),
  136.             footer: {
  137.               icon_url: client.user.avatarURL,
  138.               text: "© NotABot"
  139.             }
  140.           }
  141.         });
  142.         break;
  143.  
  144.         case "8ball":
  145.         console.log(`${message.author.tag} used the ${settings.botPREFIX}8ball command!`);
  146.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}8ball command!`);
  147.  
  148.         let question = message.content.split(' ').slice(1).join(' ');
  149.  
  150.         if (!question) {
  151.             return message.reply('What question should I answer on?\n\**Usage:** `~8ball is Blue Malgeran is sexy af?`');
  152.         }
  153.  
  154.       message.channel.send({embed: {
  155.         color: 3447003,
  156.         author: {
  157.           name: `8ball`,
  158.           icon_url: 'http://8ballsportsbar.com/wp-content/uploads/2016/02/2000px-8_ball_icon.svg_.png'
  159.         },
  160.         fields: [{
  161.             name: 'Info:',
  162.             value: `**My answer:** ${fortunes[~~(Math.random() * fortunes.length)]}`
  163.           }
  164.         ],
  165.         timestamp: new Date(),
  166.         footer: {
  167.           icon_url: client.user.avatarURL,
  168.           text: "© NotABot"
  169.         }
  170.       }
  171.     });
  172.         break;
  173.  
  174.         case "weather":
  175.         console.log(`${message.author.tag} used the ${settings.botPREFIX}weather command!`);
  176.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}weather command!`);
  177.  
  178.         let apiKey = settings.weatherAPI;
  179.         const fetch = require('node-fetch');
  180.         let arg = message.content.split(' ').join(' ').slice(9);
  181.         if (!arg) {
  182.             return message.reply('I need a city to check :wink:');
  183.         }
  184.         fetch('http://api.openweathermap.org/data/2.5/weather?q=' + arg + '&APPID=' + apiKey + '&units=metric')
  185.             .then(res => {
  186.                 return res.json();
  187.             }).then(json => {
  188.                 if (json.main === undefined) {
  189.                     return message.reply(`**${arg}** Isnt inside my query, please check again`);
  190.                 }
  191.                 let rise = json.sys.sunrise;
  192.                 let date = new Date(rise * 1000);
  193.                 let timestr = date.toLocaleTimeString();
  194.                 let set = json.sys.sunset;
  195.                 let setdate = new Date(set * 1000);
  196.                 let timesstr = setdate.toLocaleTimeString();
  197.                 const embed = new Discord.RichEmbed()
  198.               .setColor(26368)
  199.               .setTitle(`This is the weather for :flag_${json.sys.country.toLowerCase()}: **${json.name}**`)
  200.               .addField('Information:', `**Temp:** ${json.main.temp}°C\n**Wind speed:** ${json.wind.speed}m/s\n**Humidity:** ${json.main.humidity}%\n**Sunrise:** ${timestr}\n**Sunset:** ${timesstr}`);
  201.                 message.channel.send({embed})
  202.               .catch(console.error);
  203.             }).catch(err => {
  204.                 if (err) {
  205.                     message.channel.send('Something went wrong while checking the query!');
  206.                 }
  207.             });
  208.         break;
  209.  
  210.         case "invite":
  211.         console.log(`${message.author.tag} used the ${settings.botPREFIX}invite command!`);
  212.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}invite command!`);
  213.  
  214.         message.reply("Okay, you can invite me here: https://discordapp.com/oauth2/authorize?client_id=" + client.user.id + "&scope=bot&permissions=0");
  215.         break;
  216.  
  217.         case "coinflip":
  218.         console.log(`${message.author.tag} used the ${settings.botPREFIX}coinflip command!`);
  219.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}coinflip command!`);
  220.  
  221.         let answers = [
  222.             'heads',
  223.             'tails'
  224.         ];
  225.  
  226.         message.channel.send({embed: {
  227.             color: 3447003,
  228.             title: "Coinflip:",
  229.             fields: [{
  230.                 name: "Result",
  231.                 value: `\`${answers[~~(Math.random() * answers.length)]}\``
  232.               }
  233.             ],
  234.             timestamp: new Date(),
  235.             footer: {
  236.               icon_url: client.user.avatarURL,
  237.               text: "© NotABot"
  238.             }
  239.           }
  240.         });
  241.         break;
  242.  
  243.         case "userinfo":
  244.         console.log(`${message.author.tag} used the ${settings.botPREFIX}userinfo command!`);
  245.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}userinfo command!`);
  246.  
  247.         let user = message.mentions.users.first();
  248.         if (!user) {
  249.             return message.reply('You must mention someone!');
  250.         }
  251.         const mentioneduser = message.mentions.users.first();
  252.         const joineddiscord = (mentioneduser.createdAt.getDate() + 1) + '-' + (mentioneduser.createdAt.getMonth() + 1) + '-' + mentioneduser.createdAt.getFullYear() + ' | ' + mentioneduser.createdAt.getHours() + ':' + mentioneduser.createdAt.getMinutes() + ':' + mentioneduser.createdAt.getSeconds();
  253.         let game;
  254.         if (user.presence.game === null) {
  255.             game = 'Not currently Playing.';
  256.         } else {
  257.             game = user.presence.game.name;
  258.         }
  259.         let messag;
  260.         if (user.lastMessage === null) {
  261.             messag = 'He didnt sent a message.';
  262.         } else {
  263.             messag = user.lastMessage;
  264.         }
  265.         let status;
  266.         if (user.presence.status === 'online') {
  267.             status = ':green_heart:';
  268.         } else if (user.presence.status === 'dnd') {
  269.             status = ':heart:';
  270.         } else if (user.presence.status === 'idle') {
  271.             status = ':yellow_heart:';
  272.         } else if (user.presence.status === 'offline') {
  273.             status = ':black_heart:';
  274.         }
  275.       // Let afk;
  276.       // if (user.presence.data.afk === true) {
  277.       //   afk = "✅"
  278.       // } else {
  279.       //   afk = "❌"
  280.       // }
  281.         let stat;
  282.         if (user.presence.status === 'offline') {
  283.             stat = 0x000000;
  284.         } else if (user.presence.status === 'online') {
  285.             stat = 0x00AA4C;
  286.         } else if (user.presence.status === 'dnd') {
  287.             stat = 0x9C0000;
  288.         } else if (user.presence.status === 'idle') {
  289.             stat = 0xF7C035;
  290.         }
  291.       message.channel.send({embed: {
  292.         color: 3447003,
  293.         author: {
  294.           name: `Got some info about ${user.username}`,
  295.           icon_url: user.displayAvatarURL
  296.         },
  297.         fields: [{
  298.             name: '**UserInfo:**',
  299.             value: `**Username:** ${user.tag}\n**Joined Discord:** ${joineddiscord}\n**Last message:** ${messag}\n**Playing:** ${game}\n**Status:** ${status}\n**Bot?** ${user.bot}`
  300.           },
  301.           {
  302.             name: 'DiscordInfo:',
  303.             value: `**Discriminator:** ${user.discriminator}\n**ID:** ${user.id}\n**Username:** ${user.username}`
  304.           },
  305.         ],
  306.         timestamp: new Date(),
  307.         footer: {
  308.           icon_url: client.user.avatarURL,
  309.           text: "© NotABot"
  310.         }
  311.       }
  312.     });
  313.         break;
  314.  
  315.         case "avatar":
  316.         console.log(`${message.author.tag} used the ${settings.botPREFIX}avatar command!`);
  317.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}avatar command!`);
  318.        
  319.         if(message.mentions.users.first()) { //Check if the message has a mention in it.
  320.             let user = message.mentions.users.first(); //Since message.mentions.users returns a collection; we must use the first() method to get the first in the collection.
  321.             let output = user.username + "#" + user.discriminator /*Username and Discriminator*/ +
  322.             "\nAvatar URL: " + user.avatarURL; /*The Avatar URL*/
  323.             message.channel.sendMessage(output); //We send the output in the current channel.
  324.       } else {
  325.             message.reply("Please mention someone :thinking:"); //Reply with a mention saying "Invalid user."
  326.       }
  327.         break;
  328.  
  329.         case "serverinfo":
  330.         console.log(`${message.author.tag} used the ${settings.botPREFIX}serverinfo command!`);
  331.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}serverinfo command!`);
  332.  
  333.         let guildmessageServerInfo = message.guild;
  334.         let nameServerInfo = message.guild.name;
  335.         let createdAtServerInfo = moment(message.guild.createdAt).format('MMMM Do YYYY, h:mm:ss a');
  336.         let channelsServerInfo = message.guild.channels.size;
  337.         let ownerServerInfo = message.guild.owner.user.tag;
  338.         let memberCountServerInfo = message.guild.memberCount;
  339.         let largeServerInfo = message.guild.large;
  340.         let iconUrlServerInfo = message.guild.iconURL;
  341.         let regionServerInfo = message.guild.region;
  342.         let afkServerInfo = message.guild.channels.get(message.guild.afkChannelID) === undefined ? 'None' : message.guild.channels.get(guildmessageServerInfo.afkChannelID).name;
  343.  
  344.             message.channel.send({embed: {
  345.                 color: 3447003,
  346.                 author: {
  347.                   name: message.guild.name,
  348.                   icon_url: message.guild.iconURL
  349.                 },
  350.                 title: "Server Information",
  351.                 fields: [{
  352.                     name: "Channels",
  353.                     value: `**Channel Count:** ${channelsServerInfo}\n**AFK Channel:** ${afkServerInfo}`
  354.                   },
  355.                   {
  356.                     name: "Members",
  357.                     value: `**Member Count:** ${memberCountServerInfo}\n**Owner:** ${ownerServerInfo}\n**Owner ID:** ${message.guild.owner.id}`
  358.                   },
  359.                   {
  360.                     name: "More",
  361.                     value: `**Created at:** ${createdAtServerInfo}\n**Large Guild?:** ${largeServerInfo ? 'Yes' : 'No'}\n**Region:** ${regionServerInfo}`
  362.                   }
  363.                 ],
  364.                 timestamp: new Date(),
  365.                 footer: {
  366.                   icon_url: client.user.avatarURL,
  367.                   text: "© NotABot"
  368.                 }
  369.               }
  370.             });
  371.         break;
  372.  
  373.         case "botservers":
  374.         console.log(`${message.author.tag} used the ${settings.botPREFIX}botservers command!`);
  375.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}botservers command!`);
  376.  
  377.         let Table = require(`cli-table`);
  378.         let table = new Table({
  379.             head: [
  380.                 `ID`,
  381.                 `Name`,
  382.                 `Users`,
  383.                 `Bots`,
  384.                 `Total`
  385.             ], colWidths: [30, 50, 10, 10, 10]
  386.         });
  387.         client.guilds.map(g =>
  388.           table.push(
  389.             [g.id, g.name, g.members.filter(u => !u.user.bot).size, g.members.filter(u => u.user.bot).size, g.members.size]
  390.           ));
  391.         require(`snekfetch`)
  392.         .post(`https://hastebin.com/documents`)
  393.         .set(`Content-Type`, `application/raw`)
  394.         .send(table.toString())
  395.         .then(r =>
  396.            message.channel.send(`Im inside these servers! http://hastebin.com/` + r.body.key));
  397.         break;
  398.  
  399.         case "ping":
  400.         console.log(`${message.author.tag} used the ${settings.botPREFIX}ping command!`);
  401.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}ping command!`);
  402.  
  403.         var msTOcolor = (client.ping > 100) ? "15158332":"3066993"
  404.  
  405.         message.channel.send({embed: {
  406.             color: msTOcolor,
  407.             author: {
  408.               name: client.user.username,
  409.               icon_url: client.user.avatarURL
  410.             },
  411.             fields: [{
  412.                 name: "Bot's ping:",
  413.                 value: `\`${client.ping}ms\``
  414.               }
  415.             ],
  416.             timestamp: new Date(),
  417.             footer: {
  418.               icon_url: client.user.avatarURL,
  419.               text: "© NotABot"
  420.             }
  421.           }
  422.         });
  423.         break;
  424.  
  425.         case "ban":
  426.         console.log(`${message.author.tag} used the ${settings.botPREFIX}ban command!`);
  427.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}ban command!`);
  428.  
  429.         const mmss = require('ms');
  430.         let reason = message.content.split(' ').slice(3).join(' ');
  431.         let time = message.content.split(' ')[2];
  432.         let guild = message.guild;
  433.         let modlog = message.guild.channels.find('name', 'mod-log');
  434.         let usermention = message.mentions.users.first();
  435.  
  436.         if (!message.guild.member(message.author).hasPermission('BAN_MEMBERS')) {
  437.             return message.reply(':lock: **You** need `BAN_MEMBERS` Permissions to execute `ban`')
  438.         }
  439.  
  440.         if (!message.guild.member(client.user).hasPermission('BAN_MEMBERS')) {
  441.             return message.reply(':lock: **I** need `BAN_MEMBERS` Permissions to execute `ban`')
  442.         }
  443.  
  444.         if (!modlog) {
  445.             return message.reply('I need a text channel named `mod-log` to print my ban/kick logs in, please create one')
  446.         }
  447.  
  448.         if (message.mentions.users.size < 1) {
  449.             return message.reply('You need to mention someone to Ban them!')
  450.         }
  451.  
  452.         if (message.author.id === usermention.id) {
  453.             return message.reply('You cant punish yourself :wink:')
  454.         }
  455.  
  456.         if (!time) {
  457.             return message.reply(`How much time ? **Usage:**\`~ban [@mention] [1d] [example]\``)
  458.         }
  459.  
  460.         if (!time.match(/[1-7][s,m,h,d,w]/g)) {
  461.             return message.reply('I need a valid time ! look at the Usage! right here: **Usage:**`~ban [@mention] [1m] [example]`')
  462.         }
  463.  
  464.         if (!reason) {
  465.             return message.reply(`You must give me a reason for the ban **Usage:**\`~ban [@mention] [1d] [example]\``)
  466.         }
  467.  
  468.         if (!message.guild.member(usermention).bannable) {
  469.             return message.reply('This member is above me in the `role chain` Can\'t ban them')
  470.         }
  471.  
  472.         message.reply("This user has been banned from the server.");
  473.  
  474.         usermention.send(`You've just got banned from ${guild.name}  \n State reason: **${reason}** \n **Disclamer**: If the ban is not timed and Permanent you may not appeal the **BAN**!`)
  475.         message.guild.ban(usermention, 7);
  476.         setTimeout(() => {
  477.             message.guild.unban(usermention.id);
  478.         }, mmss(time));
  479.         modlog.send({embed: {
  480.             color: 3447003,
  481.             author: {
  482.               name: client.user.username,
  483.               icon_url: client.user.avatarURL
  484.             },
  485.             fields: [{
  486.                 name: "Ban:",
  487.                 value: `**Banned:** ${usermention.username}#${usermention.discriminator}\n**Moderator:** ${message.author.username} \n**Duration:** ${mmss(mmss(time), {long: true})} \n**Reason:** ${reason}`
  488.               }
  489.             ],
  490.             timestamp: new Date(),
  491.             footer: {
  492.               icon_url: client.user.avatarURL,
  493.               text: "© NotABot"
  494.             }
  495.           }
  496.         });
  497.         break;
  498.  
  499.         case "kick":
  500.         console.log(`${message.author.tag} used the ${settings.botPREFIX}kick command!`);
  501.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}kick command!`);
  502.  
  503.         if (!message.guild.member(message.author).hasPermission('KICK_MEMBERS')) {
  504.             return message.reply(':lock: You dont have permissions for that')
  505.         }
  506.         if (!message.guild.member(client.user).hasPermission('KICK_MEMBERS')) {
  507.             return message.reply(':lock: **I** need `KICK_MEMBERS` Permissions to execute `kick`')
  508.         }
  509.         let usermentionkick = message.mentions.users.first();
  510.         let reasonkick = message.content.split(' ').slice(2).join(' ');
  511.         let guildkick = message.guild;
  512.         let modlogkick = message.guild.channels.find('name', 'mod-log');
  513.         let memberkick = message.guild.member;
  514.       // If(!message.member.roles.has(adminRole.id)) return message.reply(":lock: You dont have permissions for that");
  515.         if (!modlogkick) {
  516.             return message.reply('I need a text channel named `mod-log` to print my ban/kick logs in, please create one');
  517.         }
  518.         if (message.mentions.users.size < 1) {
  519.             return message.reply('You need to mention someone to Kick him!. **Usage:**`~kick [@mention] [example]`');
  520.         }
  521.         if (!reasonkick) {
  522.             return message.reply('You must give me a reason for kick **Usage:**`~kick [@mention] [example]`');
  523.         }
  524.         if (!message.guild.member(usermentionkick).kickable) {
  525.             return message.reply('This member is above me in the `role chain` Can\'t kick him');
  526.         }
  527.         message.guild.member(usermentionkick).kick();
  528.  
  529.         modlogkick.send({embed: {
  530.             color: 3447003,
  531.             author: {
  532.               name: client.user.username,
  533.               icon_url: client.user.avatarURL
  534.             },
  535.             fields: [{
  536.                 name: "Kick:",
  537.                 value: `**Kicked:**${usermentionkick.username}#${usermentionkick.discriminator}\n**Moderator:** ${message.author.username} \n**Reason:** ${reasonkick}`
  538.               }
  539.             ],
  540.             timestamp: new Date(),
  541.             footer: {
  542.               icon_url: client.user.avatarURL,
  543.               text: "© NotABot"
  544.             }
  545.           }
  546.         });
  547.         break;
  548.  
  549.         case "mute":
  550.         console.log(`${message.author.tag} used the ${settings.botPREFIX}mute command!`);
  551.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}mute command!`);
  552.  
  553.         if (!message.guild.member(message.author).hasPermission('MUTE_MEMBERS')) {
  554.             message.channel.send(':lock: **I** need `MANAGE_ROLES` Permissions to execute `mute`');
  555.             return;
  556.         }
  557.  
  558.         if (!message.guild.member(client.user).hasPermission('MANAGE_ROLES')) {
  559.             return message.reply(':lock: **I** need `MANAGE_ROLES` Permissions to execute `mute`')
  560.         }
  561.         const msmute = require('ms');
  562.         let reasonMute = message.content.split(' ').slice(3).join(' ');
  563.         let timeMute = message.content.split(' ')[2];
  564.         let guildMute = message.guild;
  565.       // Let adminRoleMute = guild.roles.find("name", "TOA");
  566.         let memberMute = message.guild.member;
  567.         let modlogMute = message.guild.channels.find('name', 'mod-log');
  568.         let userMute = message.mentions.users.first();
  569.         let muteRoleMute = client.guilds.get(message.guild.id).roles.find('name', 'NotAMute');
  570.         if (!modlogMute) {
  571.             return message.reply('I need a text channel named `mod-log` to print my ban/kick logs in, please create one');
  572.         }
  573.  
  574.         if (!muteRoleMute) {
  575.             return message.reply('`Please create a role called "NotAMute"`');
  576.         }
  577.  
  578.         if (message.mentions.users.size < 1) {
  579.             return message.reply('You need to mention someone to Mute him!.');
  580.         }
  581.         if (message.author.id === userMute.id) {
  582.             return message.reply('You cant punish yourself :wink:');
  583.         }
  584.         if (!timeMute) {
  585.             return message.reply('specify the time for the mute!**Usage:**`~mute [@mention] [1m] [example]`');
  586.         }
  587.         if (!timeMute.match(/[1-60][s,m,h,d,w]/g)) {
  588.             return message.reply('I need a valid time ! look at the Usage! right here: **Usage:**`~mute [@mention] [1m] [example]`');
  589.         }
  590.         if (!reasonMute) {
  591.             return message.reply('You must give me a reason for Mute **Usage:**`~mute [@mention] [15m] [example]`');
  592.         }
  593.         if (reasonMute.time < 1) {
  594.             return message.reply('TIME?').then(message => message.delete(2000));
  595.         }
  596.         if (reasonMute.length < 1) {
  597.             return message.reply('You must give me a reason for Mute');
  598.         }
  599.         message.guild.member(userMute).addRole(muteRoleMute)
  600.  
  601.         setTimeout(() => {
  602.             message.guild.member(userMute).removeRole(muteRoleMute)
  603.         }, msmute(timeMute));
  604.         message.guild.channels.filter(textchannel => textchannel.type === 'text').forEach(cnl => {
  605.             cnl.overwritePermissions(muteRoleMute, {
  606.                 SEND_MESSAGES: false
  607.             });
  608.         });
  609.  
  610.         message.reply("This user has been muted.");
  611.  
  612.         modlogMute.send({embed: {
  613.             color: 16745560,
  614.             author: {
  615.               name: client.user.username,
  616.               icon_url: client.user.avatarURL
  617.             },
  618.             fields: [{
  619.                 name: 'Mute',
  620.                 value: `**Muted:**${userMute.username}#${userMute.discriminator}\n**Moderator:** ${message.author.username}\n**Duration:** ${msmute(msmute(timeMute), {long: true})}\n**Reason:** ${reasonMute}`
  621.               }
  622.             ],
  623.             timestamp: new Date(),
  624.             footer: {
  625.               icon_url: client.user.avatarURL,
  626.               text: "© NotABot"
  627.             }
  628.           }
  629.         });
  630.         break;
  631.  
  632.         case "unmute":
  633.         console.log(`${message.author.tag} used the ${settings.botPREFIX}unmute command!`);
  634.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}unmute command!`);
  635.  
  636.         let guildUnmute = message.guild;
  637.         let argsUnmute = message.content.split(' ').slice(1);
  638.         let argresultUnmute = args.join(' ');
  639.         let reasonUnmute = args;
  640.         if (!message.guild.member(message.author).hasPermission('MUTE_MEMBERS')) {
  641.             return message.reply(':lock: **You** need `MUTE_MEMBERS` Permissions to execute `unmute`')
  642.         }
  643.         if (!message.guild.member(client.user).hasPermission('MANAGE_ROLES')) {
  644.             return message.reply(':lock: **I** need `MANAGE_ROLES` Permissions to execute `unmute`')
  645.         }
  646.         let userUnmute = message.mentions.users.first();
  647.         let muteRoleUnmute = client.guilds.get(message.guild.id).roles.find('name', 'NotAMute');
  648.         if (message.mentions.users.size < 1) {
  649.             return message.reply('You need to mention someone to unmute him!.');
  650.         }
  651.         message.guild.member(userUnmute).removeRole(muteRoleUnmute).then(() => {
  652.             message.channel.send(`You've succesfully unmuted ${userUnmute}`);
  653.         });
  654.         break;
  655.  
  656.         case "quote":
  657.         console.log(`${message.author.tag} used the ${settings.botPREFIX}quote command!`);
  658.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}quote command!`);
  659.  
  660.         const fetchquote = require('snekfetch');
  661.         fetchquote.get('http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=json&lang=en').then(quote => {
  662.             if (quote.body.quoteText === undefined) {
  663.                 return message.reply('Something is messing up the API try again please!');
  664.             }
  665.  
  666.             message.channel.send({embed: {
  667.                 color: 3447003,
  668.                 author: {
  669.                   name: 'A smart guy said once:',
  670.                   icon_url: 'http://pngimages.net/sites/default/files/right-double-quotation-mark-png-image-80280.png'
  671.                 },
  672.                 fields: [{
  673.                     name: "Quote with source",
  674.                     value: `"${quote.body.quoteText}"\n**Author:** ${quote.body.quoteAuthor}\n**Source:** ${quote.body.quoteLink}`
  675.                   }
  676.                 ],
  677.                 timestamp: new Date(),
  678.                 footer: {
  679.                   icon_url: client.user.avatarURL,
  680.                   text: "© NotABot"
  681.                 }
  682.             }
  683.         })
  684.         });
  685.         break;
  686.  
  687.         case "notice":
  688.         console.log(`${message.author.tag} used the ${settings.botPREFIX}notice command!`);
  689.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}notice command!`);
  690.  
  691.         var hugs = [
  692.             "`\(^o^)/`",
  693.             "`d=(´▽`)=b`",
  694.             "`⊂((・▽・))⊃`",
  695.             "`⊂( ◜◒◝ )⊃`",
  696.             "`⊂(♡⌂♡)⊃`",
  697.             "`⊂(◉‿◉)つ`"
  698.         ];
  699.         message.reply(`${hugs[~~(Math.random() * hugs.length)]}`);
  700.         break;
  701.  
  702.         case "softban":
  703.         console.log(`${message.author.tag} used the ${settings.botPREFIX}softban command!`);
  704.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}softban command!`);
  705.  
  706.         let reasonSoftban = message.content.split(' ').slice(7).join(' ');
  707.         let timeSoftban = message.content.split(' ')[2];
  708.         let guildSoftban = message.guild;
  709.         let modlogSoftban = message.guild.channels.find('name', 'mod-log');
  710.         let userSoftban = message.mentions.users.first();
  711.         if (!message.guild.member(message.author).hasPermission('BAN_MEMBERS')) {
  712.             return message.reply(':lock: You need to have `BAN_MEMBERS` Permission to execute `SoftBan`');
  713.         }
  714.         if (!message.guild.member(client.user).hasPermission('BAN_MEMBERS')) {
  715.             return message.reply(':lock: I need to have `BAN_MEMBERS` Permission to execute `SoftBan`');
  716.         }
  717.         if (!modlogSoftban) {
  718.             return message.reply('I need a text channel named `mod-log` to print my ban/kick logs in, please create one');
  719.         }
  720.         if (message.author.id === userSoftban.id) {
  721.             return message.reply('You cant punish yourself :wink:');
  722.         }
  723.         if (message.mentions.users.size < 1) {
  724.             return message.reply('You need to mention someone to SoftBan him!');
  725.         }
  726.         if (!reasonSoftban) {
  727.             return message.reply(`You must give me a reason for the ban **Usage:**\`~softban [@mention] [example]\``);
  728.         }
  729.         userSoftban.send(`You've just got softbanned from ${guildSoftban.name}  \n State reason: **${reasonSoftban}** \n **Disclamer**: In a softban you can come back straight away, we just got your messages deleted`);
  730.         message.guild.ban(userSoftban, 2);
  731.         setTimeout(() => {
  732.             message.guild.unban(userSoftban.id);
  733.         }, 0);
  734.  
  735.         modlogSoftban.send({embed: {
  736.             color: 0x18FE26,
  737.             author: {
  738.               name: client.user.username,
  739.               icon_url: client.user.avatarURL
  740.             },
  741.             fields: [{
  742.                 name: "Softban:",
  743.                 value: `**Softbanned:** ${userSoftban.username}#${userSoftban.discriminator}\n**Moderator:** ${message.author.username}\n**Reason:** ${reasonSoftban}`
  744.               }
  745.             ],
  746.             timestamp: new Date(),
  747.             footer: {
  748.               icon_url: client.user.avatarURL,
  749.               text: "© NotABot"
  750.             }
  751.           }
  752.         });
  753.         break;
  754.  
  755.         case "todo":
  756.         console.log(`${message.author.tag} used the ${settings.botPREFIX}todo command!`);
  757.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}todo command!`);
  758.  
  759.         if (message.author.id == '153478211207036929') {
  760.             return message.channel.send(`**Unban command.**\n
  761. **Bot's owner commands.**\n
  762. **Some fun commands.**\n
  763. ~~Mute command~~\n
  764. ~~Unmute command~~\n
  765. ~~Server info~~\n
  766. ~~Softban command\n~~
  767. **~~watch porn man~~**`);
  768.         } else {
  769.             message.react('❌');
  770.             message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  771.         }
  772.         break;
  773.  
  774.         case "botname":
  775.         console.log(`${message.author.tag} used the ${settings.botPREFIX}botname command!`);
  776.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}botname command!`);
  777.  
  778.         const botusername = message.content.split(' ').slice(1).join(' ');
  779.  
  780.         if (message.author.id == settings.ownerID) {
  781.             client.user.setUsername(botusername);
  782.             message.reply('Done. :ok_hand:');
  783.         } else {
  784.             message.react('❌');
  785.             message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  786.         }
  787.         break;
  788.  
  789.         case "botavatar":
  790.         console.log(`${message.author.tag} used the ${settings.botPREFIX}botavatar command!`);
  791.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}botavatar command!`);
  792.  
  793.         const botavatar = message.content.split(' ').slice(1).join(' ');
  794.         var request = require("request").defaults({ "encoding" : null });
  795.  
  796.         if (message.author.id == settings.ownerID) {
  797. request(botavatar, function (err, res, body) {
  798.     if (!err && res.statusCode === 200) {
  799.         var data = "data:" + res.headers["content-type"] + ";base64," + new Buffer(body).toString("base64");
  800.         client.user.setAvatar(botavatar).catch((error) => { message.channel.send('Beep boop, something went wrong. Check the console to see the error.'); console.log('Error on setavatar command:', error); });
  801.  
  802.         message.channel.send('Done. :ok_hand:');
  803.     }
  804. });
  805.         } else {
  806.             message.react('❌');
  807.             message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  808.         }
  809.         break;
  810.  
  811.         case "botnick":
  812.         console.log(`${message.author.tag} used the ${settings.botPREFIX}botnick command!`);
  813.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}botnick command!`);
  814.  
  815.         const botnickname = message.content.split(' ').slice(1).join(' ');
  816.  
  817.         if (message.author.id == settings.ownerID){
  818.             message.guild.members.get(client.user.id).setNickname(botnickname);
  819.             message.channel.send('Done. :ok_hand:');
  820.         } else {
  821.             message.react('❌');
  822.             message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  823.         }
  824.         break;
  825.  
  826.         case "eval":
  827.         console.log(`${message.author.tag} used the ${settings.botPREFIX}eval command!`);
  828.  
  829.         const clean = text => {
  830.             if (typeof(text) === "string")
  831.               return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  832.             else
  833.                 return text;
  834.           }
  835.  
  836.             const evalargs = message.content.split(" ").slice(1);
  837.  
  838.               if (message.author.id == settings.ownerID || message.author.id == '153478211207036929') {
  839.               try {
  840.                 const code = evalargs.join(" ");
  841.                 let evaled = eval(code);
  842.  
  843.                 if (typeof evaled !== "string")
  844.                   evaled = require("util").inspect(evaled);
  845.  
  846.                 message.channel.send(clean(evaled), {code:"xl"});
  847.               } catch (err) {
  848.                 message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
  849.               }
  850.             } else {
  851.                 message.react('❌');
  852.                 message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  853.             };
  854.         break;
  855.  
  856.         case "issue":
  857.         console.log(`${message.author.tag} used the ${settings.botPREFIX}issue command!`);
  858.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}issue command!`);
  859.  
  860.         message.reply('If the bot got some bugs you can report them here! :heart: https://github.com/BlueMalgeran/NotABot/issues');
  861.         break;
  862.  
  863.         case "request":
  864.         console.log(`${message.author.tag} used the ${settings.botPREFIX}request command!`);
  865.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}request command!`);
  866.  
  867.         message.reply('If you want to request more cool features to the bot, you can request them here! :heart: https://github.com/BlueMalgeran/NotABot/pulls');
  868.         break;
  869.  
  870.         case "shutdown":
  871.         console.log(`${message.author.tag} used the ${settings.botPREFIX}shutdown command!`);
  872.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}shutdown command!`);
  873.  
  874.         if (message.author.id == settings.ownerID || message.author.id == "153478211207036929") {
  875.                 const filterYes = m => m.content.startsWith('yes');
  876.                 message.reply('Shutting down... :skull:')
  877.                 .then(m => {
  878.                     process.exit()
  879.                 });
  880.         } else {
  881.             message.react('❌');
  882.             message.channel.send(`\`📛\` You don't have permissions to execute that command.`);
  883.         }
  884.         break;
  885.  
  886.         case "roll":
  887.         console.log(`${message.author.tag} used the ${settings.botPREFIX}roll command!`);
  888.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}roll command!`);
  889.  
  890.         let rollnumber = message.content.split(' ').slice(1).join(' ');
  891.  
  892.         if (!rollnumber) {
  893.             return message.reply(`:game_die: Just rolled a number: **${Math.floor(Math.random() * 100) + 1}**`);
  894.         }
  895.  
  896.         message.reply(`:game_die: Just rolled a number: **${Math.floor(Math.random() * rollnumber) + 1}**`);
  897.         break;
  898.  
  899.         case "dick":
  900.         console.log(`${message.author.tag} used the ${settings.botPREFIX}dick command!`);
  901.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}dick command!`);
  902.         // pretty shitty command
  903.  
  904.         let dicksize = ["8=D", "8==D", "8===D", "8====D", "8=====D", "8======D", "8=======D", "8========D", "8=========D", "8==========D", "404 not found"];
  905.         let dickuser = message.mentions.users.first();
  906.  
  907.         if (!dickuser) {
  908.             return message.channel.send('You must mention someone!\n(This is 100% accurate!)');
  909.         }
  910.         if (dickuser.id == "153478211207036929") {
  911.             return message.channel.send(`**${dickuser} Size: ** 8=============================D\nSized by **${message.author.tag}**`);
  912.         }
  913.  
  914.         message.channel.send(`**${dickuser} Size: ** ${dicksize[~~Math.floor(Math.random() * dicksize.length)]}\nSized by **${message.author.tag}**`);
  915.         break;
  916.  
  917.         case "dog":
  918.         console.log(`${message.author.tag} used the ${settings.botPREFIX}dog command!`);
  919.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}dog command!`);
  920.  
  921.         const dogsuperagent = require('superagent');
  922.  
  923.         let {body} = await dogsuperagent
  924.         .get(`https://random.dog/woof.json`);
  925.  
  926.         let dogpicembed = new Discord.RichEmbed()
  927.         .setColor('#ff9900')
  928.         .setTitle('Dog Picture')
  929.         .setImage(body.url);
  930.  
  931.         message.channel.send(dogpicembed);
  932.         break;
  933.        
  934.         case "say":
  935.         console.log(`${message.author.tag} used the ${settings.botPREFIX}say command!`);
  936.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}say command!`);
  937.  
  938.         const botsay = message.content.split(' ').slice(1).join(' ');
  939.  
  940.         if (!botsay) return message.channel.send('Please tell me what to say!');
  941.  
  942.             message.delete();
  943.             message.channel.send(botsay);
  944.         break;
  945.  
  946.         case "translate":
  947.         console.log(`${message.author.tag} used the ${settings.botPREFIX}translate command!`);
  948.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}translate command!`);
  949.  
  950.         const translate = require('google-translate-api');
  951.  
  952.     let toTrans = message.content.split(' ').slice(1);
  953.     let language;
  954.  
  955.     language = toTrans[toTrans.length - 2] === 'to' ? toTrans.slice(toTrans.length - 2, toTrans.length)[1].trim() : undefined;
  956.     if (!language) {
  957.         return message.reply(`Please supply valid agruments.\n**Example** \`${settings.botPREFIX}translate [text] to [language]\``);
  958.     }
  959.     let finalToTrans = toTrans.slice(toTrans.length - toTrans.length, toTrans.length - 2).join(' ');
  960.     translate(finalToTrans, {to: language}).then(res => {
  961.             message.channel.send({embed: {
  962.                 color: 3447003,
  963.                 author: {
  964.                   name: 'NotABot\'s translator',
  965.                   icon_url: client.user.avatarURL
  966.                 },
  967.                 fields: [{
  968.                     name: "Translator",
  969.                     value: `**From:** ${res.from.language.iso}\n\`\`\`${finalToTrans}\`\`\`\n**To: **${language}\n\`\`\`${res.text}\`\`\``
  970.                   }
  971.                 ],
  972.                 timestamp: new Date(),
  973.                 footer: {
  974.                   icon_url: client.user.avatarURL,
  975.                   text: "© NotABot"
  976.                 }
  977.               }
  978.             });
  979.     }).catch(err => {
  980.         message.channel.send({
  981.             embed: {
  982.                 description: '❌ We could not find the supplied language.',
  983.                 color: 0xE8642B
  984.             }
  985.         });
  986.     });
  987.         break;
  988.  
  989.         case "anime":
  990.         console.log(`${message.author.tag} used the ${settings.botPREFIX}anime command!`);
  991.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}anime command!`);
  992.        
  993.         const animesf = require('snekfetch');
  994.  
  995.             let res = await animesf.get('http://api.cutegirls.moe/json');
  996.             if (res.body.status !== 200) {
  997.                 return message.channel.send('An error occurred while processing this command.');
  998.             }
  999.             let animepicembed = new Discord.RichEmbed()
  1000.             .setColor('#f266f9')
  1001.             .setTitle('Anime Picture')
  1002.             .setImage(res.body.data.image);
  1003.    
  1004.             message.channel.send(animepicembed);
  1005.         break;
  1006.  
  1007.         case "caps":
  1008.         console.log(`${message.author.tag} used the ${settings.botPREFIX}caps command!`);
  1009.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}caps command!`);
  1010.  
  1011.         const sponge = require('spongeuscator');
  1012.  
  1013.         if (message.content.split(' ').slice(1).join(' ').length < 4) return message.channel.send('Please give a message with more than 4 chars');
  1014.         message.channel.send(sponge(message.content.split(' ').slice(1).join(' ')));
  1015.         break;
  1016.  
  1017.         case "advice":
  1018.         console.log(`${message.author.tag} used the ${settings.botPREFIX}advice command!`);
  1019.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}advice command!`);
  1020.  
  1021.         const advicesf = require('snekfetch');
  1022.  
  1023.             let r = await advicesf.get('http://api.adviceslip.com/advice');
  1024.  
  1025.             let advice = JSON.parse(r.body).slip.advice;
  1026.  
  1027.             message.channel.send({embed: {
  1028.                 color: 3447003,
  1029.                 author: {
  1030.                   name: client.user.username,
  1031.                   icon_url: client.user.avatarURL
  1032.                 },
  1033.                 fields: [{
  1034.                     name: "Advice:",
  1035.                     value: `\`${advice}\``
  1036.                   }
  1037.                 ],
  1038.                 timestamp: new Date(),
  1039.                 footer: {
  1040.                   icon_url: client.user.avatarURL,
  1041.                   text: "© NotABot"
  1042.                 }
  1043.               }
  1044.             });
  1045.         break;
  1046.  
  1047.         case "donate":
  1048.         console.log(`${message.author.tag} used the ${settings.botPREFIX}donate command!`);
  1049.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}donate command!`);
  1050.  
  1051.         message.channel.send(`Hey there, Do want to donate for \`NotABot\`? This is the link https://www.patreon.com/NotABotDiscord, but, Why would you donate us?\n\
  1052. **1.** I'm doing it for free and trying to help people with NotABot\n\
  1053. **2.** NotABot is under 24/7 host and I need to pay for it..\n\
  1054. **3.** I'm working on this bot everyday and putting my daily effort in it!\n\
  1055. **Thank you if you decided to become a patron!** :heart:`);
  1056.         break;
  1057.  
  1058.         case "server":
  1059.         console.log(`${message.author.tag} used the ${settings.botPREFIX}server command!`);
  1060.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}server command!`);
  1061.         message.channel.send(`You can join NotABot's server by clicking on this link:\n**https://discord.gg./KugMg6K**`);
  1062.         break;
  1063.  
  1064.         case "stats":
  1065.         console.log(`${message.author.tag} used the ${settings.botPREFIX}stats command!`);
  1066.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}stats command!`);
  1067.  
  1068.         let { version } = require("discord.js");
  1069.         let statsmoment = require("moment");
  1070.         require("moment-duration-format");
  1071.         let duration = statsmoment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
  1072.  
  1073. message.channel.send({embed: {
  1074.     color: 3447003,
  1075.     author: {
  1076.         name: client.user.username,
  1077.         icon_url: client.user.avatarURL
  1078.     },
  1079.     title: "Stats:",
  1080.     fields: [
  1081.       { name: ":fire: Memory", value: `**${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB**`, inline: true},
  1082.       { name: ":clock1030:  Uptime", value: `**${duration}**`, inline: true},
  1083.       { name: ":speech_balloon: Servers", value: `**${client.guilds.size.toLocaleString()}**`, inline: true},
  1084.       { name: ":runner: Users", value: `**${client.users.size.toLocaleString()}**`, inline: true},
  1085.       { name: ":incoming_envelope: Discord.js", value: `**v${version}**`, inline: true},
  1086.       { name: ":white_check_mark: Node.js", value: `**${process.version}**`, inline: true}
  1087.     ],
  1088.     timestamp: new Date(),
  1089.     footer: {
  1090.         icon_url: client.user.avatarURL,
  1091.         text: "© NotABot"
  1092.     }
  1093.   }
  1094. });
  1095.         break;
  1096.  
  1097.         case "clear":
  1098.             console.log(`${message.author.tag} used the ${settings.botPREFIX}clear command!`);
  1099.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}clear command!`);
  1100.  
  1101.             if (!message.guild.member(message.author).hasPermission('MANAGE_MESSAGES')) return message.reply(':lock: **You** need `MANAGE_MESSAGES` permissions to execute `clear`');
  1102.             if (!message.guild.member(client.user).hasPermission('MANAGE_MESSAGES')) return message.reply(':lock: **I** need `MANAGE_MESSAGES` Permissions to execute `clear`');
  1103.             const firstUserClear = message.mentions.users.first();
  1104.             const amount = !!parseInt(message.content.split(' ')[1]) ? parseInt(message.content.split(' ')[1]) : parseInt(message.content.split(' ')[2])
  1105.             if (!amount) return message.reply('Must specify an amount to delete!');
  1106.             if (!amount && !firstUserClear) return message.reply('Must specify a user and amount, or just an amount, of messages to purge!');
  1107.             message.channel.fetchMessages({
  1108.                 limit: amount,
  1109.             }).then((messages) => {
  1110.                 if (firstUserClear) {
  1111.                     const filterBy = firstUserClear ? firstUserClear.id : client.user.id;
  1112.                     messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
  1113.                 }
  1114.                 message.channel.bulkDelete(messages).catch(error => console.log(error.stack));
  1115.             });
  1116.             break;
  1117.  
  1118.             case "botstatus":
  1119.             console.log(`${message.author.tag} used the ${settings.botPREFIX}botstatus command!`);
  1120.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}botstatus command!`);
  1121.  
  1122.             let setStatusArgs = message.content.split(' ').slice(1).join(' ');
  1123.            
  1124.             if (!message.author.id == settings.ownerID) return message.channel.send(`\`📛\` You're not allowed to execute this command!`);
  1125.             if (!setStatusArgs) return message.channel.send(`**Missing argument.**\nExample: **${settings.botPREFIX}setstatus [online, idle, dnd, invisible]**`);
  1126.             if (!setStatusArgs == "online" || "idle" || "dnd" || "invisible") return message.channel.send(`**Wrong argument.**\nExample: **${settings.botPREFIX}setstatus [online, idle, dnd, invisible]**`);
  1127.  
  1128.             client.user.setStatus(setStatusArgs)
  1129.             .then(message.channel.send('Done. :ok_hand:'));
  1130.             break;
  1131.  
  1132.             case "calc":
  1133.             console.log(`${message.author.tag} used the ${settings.botPREFIX}calc command!`);
  1134.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}calc command!`);
  1135.                 let math = require('math-expression-evaluator');
  1136.                 let calcArgs = message.content.split(' ').slice(1).join(' ');
  1137.  
  1138.                 if (!calcArgs[0]) {
  1139.                     message.channel.send({embed: {
  1140.                         color: 3447003,
  1141.                         footer: {
  1142.                           icon_url: client.user.avatarURL,
  1143.                           text: "Please input an expression."
  1144.                         }
  1145.                       }
  1146.                     });
  1147.                 }
  1148.                 let calcResult;
  1149.                 try {
  1150.                     calcResult = math.eval(calcArgs);
  1151.                 } catch (e) {
  1152.                     calcResult = 'Error: "Invalid Input"';
  1153.                 }
  1154.  
  1155.                 message.channel.send({embed: {
  1156.                     color: 3447003,
  1157.                     author: {
  1158.                       name: 'NotABot\'s calculator',
  1159.                       icon_url: client.user.avatarURL
  1160.                     },
  1161.                     fields: [
  1162.                         { name: "Input", value: `\`\`\`js\n${calcArgs}\`\`\`` },
  1163.                       { name: "Output", value: `\`\`\`js\n${calcResult}\`\`\`` }
  1164.                     ],
  1165.                     timestamp: new Date(),
  1166.                     footer: {
  1167.                       icon_url: client.user.avatarURL,
  1168.                       text: "© NotABot"
  1169.                     }
  1170.                   }
  1171.                 });
  1172.             break;
  1173.        
  1174.         // Help commands :)
  1175.         case "help":
  1176.         console.log(`${message.author.tag} used the ${settings.botPREFIX}help command!`);
  1177.             logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}help command!`);
  1178.  
  1179.         try {
  1180.             message.reply("Please check your direct messages :inbox_tray:");
  1181.  
  1182.             message.react('✅');
  1183.  
  1184.             message.author.send({embed: {
  1185.             color: 3447003,
  1186.             title: "Bot's commands",
  1187.             fields: [{
  1188.                 name: "Regular commands",
  1189.                 value: `**${settings.botPREFIX}help** - This message!\n\
  1190. **${settings.botPREFIX}modhelp** - Commands for admins and mods\n\
  1191. **${settings.botPREFIX}ownerhelp** - Owner's commands\n\
  1192. **${settings.botPREFIX}bluehelp** - secret\n\
  1193. **${settings.botPREFIX}ping** - How much ms?\n\
  1194. **${settings.botPREFIX}info** - Give you info about the bot\n\
  1195. **${settings.botPREFIX}8ball** - Ask the bot a (yes/no) question\n\
  1196. **${settings.botPREFIX}weather** - Send a place in the world\n\
  1197. **${settings.botPREFIX}invite** - Invite the bot\n\
  1198. **${settings.botPREFIX}server** - Join NotABot's server\n\
  1199. **${settings.botPREFIX}coinflip** - Flips a coin!\n\
  1200. **${settings.botPREFIX}userinfo** - Mention user for info\n\
  1201. **${settings.botPREFIX}avatar** - Get user's avatar\n\
  1202. **${settings.botPREFIX}stats** - Bot's stats\n\
  1203. **${settings.botPREFIX}serverinfo** - See server stats\n\
  1204. **${settings.botPREFIX}botservers** - Bot's servers\n\
  1205. **${settings.botPREFIX}quote** - Quotes by people\n\
  1206. **${settings.botPREFIX}notice** - I'll hug you\n\
  1207. **${settings.botPREFIX}issue** - Report a bug\n\
  1208. **${settings.botPREFIX}request** - Request new features\n\
  1209. **${settings.botPREFIX}roll** - Rolls a random number!\n\
  1210. **${settings.botPREFIX}dick** - Sizing a dick.\n\
  1211. **${settings.botPREFIX}dog** - Sends a picture of dog!\n\
  1212. **${settings.botPREFIX}translate** - Translates a textץ\n\
  1213. **${settings.botPREFIX}anime** - Sends a anime picץ\n\
  1214. **${settings.botPREFIX}caps** - Random capsץ\n\
  1215. **${settings.botPREFIX}advice** - Gives you an adviceץ\n\
  1216. **${settings.botPREFIX}donate** - Help NotABot?\n\
  1217. **${settings.botPREFIX}say** - Tell me what to say.\n\
  1218. **${settings.botPREFIX}calc** - Math questions calculator.`
  1219.               }
  1220.             ],
  1221.             timestamp: new Date(),
  1222.             footer: {
  1223.               icon_url: client.user.avatarURL,
  1224.               text: "© NotABot"
  1225.             }
  1226.           }
  1227.         });
  1228.  
  1229.         message.author.send('NotABot | Made by Blue Malgeran');
  1230.         }
  1231.         catch(err) {
  1232.             message.channel.send('I could not send you my commands!');
  1233.         }
  1234.         break;
  1235.  
  1236.     case "modhelp":
  1237.     console.log(`${message.author.tag} used the ${settings.botPREFIX}modhelp command!`);
  1238.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}modhelp command!`);
  1239.  
  1240.     message.react('✅');
  1241.    
  1242.     message.reply("Please check your direct messages :inbox_tray: (Moderation commands.)");
  1243.  
  1244.     message.author.send({embed: {
  1245.         color: 3447003,
  1246.         author: {
  1247.           name: client.user.username,
  1248.           icon_url: client.user.avatarURL
  1249.         },
  1250.         title: "Bot's commands",
  1251.         fields: [{
  1252.             name: "Moderation commands",
  1253.             value: `**${settings.botPREFIX}ban** - Bans a user from your server! (Moderators only!)\n\
  1254. **${settings.botPREFIX}kick** - Kicks a user out of the server! (Mederation only!)\n\
  1255. **${settings.botPREFIX}mute** - Muted a user with a **muted** role! (Moderation only!)\n\
  1256. **${settings.botPREFIX}unmute** - Unmutes a user and removes the **muted** role. (Moderation only!)\n\
  1257. **${settings.botPREFIX}softban** - Kicks a user and deletes his messages. (Moderation only!)\n\
  1258. **${settings.botPREFIX}clear** - Clear messages / user's messages! (Moderation only!)`
  1259.           }
  1260.         ],
  1261.         timestamp: new Date(),
  1262.         footer: {
  1263.           icon_url: client.user.avatarURL,
  1264.           text: "© NotABot"
  1265.         }
  1266.       }
  1267.     });
  1268.     message.author.send('NotABot | Made by Blue Malgeran');
  1269.     break;
  1270.  
  1271.     case "ownerhelp":
  1272.     console.log(`${message.author.tag} used the ${settings.botPREFIX}ownerhelp command!`);
  1273.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}ownerhelp command!`);
  1274.  
  1275.     if (message.author.id == settings.ownerID) {
  1276.         message.react('✅');
  1277.  
  1278.         message.reply("Please check your direct messages :inbox_tray: (Owner commands.)");
  1279.  
  1280.         message.author.send({embed: {
  1281.             color: 3447003,
  1282.             author: {
  1283.               name: client.user.username,
  1284.               icon_url: client.user.avatarURL
  1285.             },
  1286.             title: "Bot's commands",
  1287.             fields: [{
  1288.                 name: "Bot's owner commands",
  1289.                 value: `**${settings.botPREFIX}botname** - Changes the bot's username. **Usage: ${settings.botPREFIX}botname [NAME]**\n\
  1290. **${settings.botPREFIX}botavatar** - Changes the bot's avatar. **Usage: ${settings.botPREFIX}botavatar [LINK]**\n\
  1291. **${settings.botPREFIX}botnick** - Changed the nickname in a server. **Usage: ${settings.botPREFIX}botnick [NICKNAME]**\n\
  1292. **${settings.botPREFIX}eval** - Evaluates a code. **Usage: ${settings.botPREFIX}eval [CODE]**\n\
  1293. **${settings.botPREFIX}shutdown** - Closes the CMD window!\n\
  1294. **${settings.botPREFIX}botstatus** - Change the bot's status! **Usage: ${settings.botPREFIX}botstats [STATUS]**`
  1295.               }
  1296.             ],
  1297.             timestamp: new Date(),
  1298.             footer: {
  1299.               icon_url: client.user.avatarURL,
  1300.               text: "© NotABot"
  1301.             }
  1302.           }
  1303.         });
  1304.         message.author.send('NotABot | Made by Blue Malgeran');
  1305.     } else {
  1306.         message.react('❌');
  1307.         message.channel.send(`\`📛\` Only the owner of the bot can use this command.`);
  1308.     }
  1309.     break;
  1310.  
  1311.     case "bluehelp":
  1312.     console.log(`${message.author.tag} used the ${settings.botPREFIX}bluehelp command!`);
  1313.         logsCommands.send(`${message.author.tag} used the ${settings.botPREFIX}bluehelp command!`);
  1314.  
  1315.     if (message.author.id == '153478211207036929') {
  1316.         message.react('✅');
  1317.  
  1318.         message.reply('Hello there my lord! Check your DM :wink:');
  1319.  
  1320.         message.author.send({embed: {
  1321.             color: 3447003,
  1322.             author: {
  1323.               name: client.user.username,
  1324.               icon_url: client.user.avatarURL
  1325.             },
  1326.             title: "Bot's commands",
  1327.             fields: [{
  1328.                 name: "Blue Malgeran's commands",
  1329.                 value: `**${settings.botPREFIX}todo** - Shows Blue Malgeran's TODO list.\n\
  1330. **${settings.botPREFIX}eval** - Evaluates a code.\n\
  1331. **${settings.botPREFIX}shutdown** - Closes the CMD window.`
  1332.               }
  1333.             ],
  1334.             timestamp: new Date(),
  1335.             footer: {
  1336.               icon_url: client.user.avatarURL,
  1337.               text: "© NotABot"
  1338.             }
  1339.           }
  1340.         });
  1341.         message.author.send('NotABot | Made by Blue Malgeran');
  1342.     } else {
  1343.         message.react('❌');
  1344.         message.channel.send(`\`📛\` You're not allowed to execute this command, only my lord can use this command!\n\
  1345.         \`Lord: Blue Malgeran#3106\``);
  1346.     }
  1347.     break;
  1348.     }
  1349. });
  1350.  
  1351. // Bot's token (Synced from settings.json)
  1352. client.login(settings.botTOKEN)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top