SHARE
TWEET

Untitled

a guest May 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const bot = new Discord.Client();
  3.  
  4. const token = 'NDM0NTI5ODE1NDUwNjE1ODEy.XOPnxg.lfJR3B7IXGDGu8eVGlmFNLAoDTc';
  5.  
  6. const PREFIX = '!';
  7.  
  8. var version = '1.4.6';
  9.  
  10. bot.on('ready', () => {
  11.     console.log('This bot is online!');
  12.     bot.user.setActivity('281 Servers | Supports any prefix!', { type: 'WATCHING' })
  13.  
  14. })
  15.  
  16. bot.on('message', message => {
  17.  
  18.     let args = message.content.substring(PREFIX.length).split(" ");
  19.  
  20.     switch (args[0]) {
  21.         case 'userinfo':
  22.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  23.                 .then(msg => msg.delete(5000));
  24.             var embed = new Discord.RichEmbed()
  25.                 .setTitle('User Information')
  26.                 .addField('Player Name', message.author.username)
  27.                 .addField('Server name', message.guild.name)
  28.                 .setColor(0xB89F20)
  29.                 .setThumbnail(message.author.avatarURL)
  30.                 .setFooter('Made by press alt+f4#1684 DM me to say thank you ;) XD')
  31.             message.channel.sendEmbed(embed);
  32.  
  33.             break;
  34.  
  35.         case 'ping':
  36.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  37.                 .then(msg => msg.delete(5000));
  38.             message.channel.sendMessage('pong!');
  39.             break;
  40.  
  41.         case 'learn':
  42.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  43.                 .then(msg => msg.delete(5000));
  44.             message.reply('Special Shout out to https://www.youtube.com/watch?v=OQsUnFDT7iE for helping press alt+f4#1684 making me :)')
  45.             break;
  46.  
  47.         case 'version':
  48.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  49.                 .then(msg => msg.delete(5000));
  50.             message.channel.sendMessage('Version ' + version);
  51.             break;
  52.  
  53.         case 'clear':
  54.             if (!message.member.roles.find(r => r.name === "VIP [GOLD]")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  55.                 .then(msg => msg.delete(5000));
  56.             if (!args[1]) return message.reply('Error please define second arg')
  57.             message.channel.bulkDelete(args[1]);
  58.             break;
  59.  
  60.         case 'kick':
  61.             if (!message.member.roles.find(r => r.name === "Moderating Team")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  62.                 .then(msg => msg.delete(5000));
  63.  
  64.  
  65.             var user = message.mentions.users.first();
  66.  
  67.             if (user) {
  68.                 var member = message.guild.member(user);
  69.  
  70.                 if (member) {
  71.                     member.kick('You were kicked!').then(() => {
  72.                         message.reply(`Succesfully kicked ${user.tag}`);
  73.                     }).catch(err => {
  74.                         message.reply('I was unable to kick the user');
  75.                         console.log(err);
  76.                     });
  77.                 } else {
  78.                     message.reply("That user isn\'t in this server")
  79.                 }
  80.             } else {
  81.                 message.reply('You need to specify a person!')
  82.             }
  83.             break;
  84.  
  85.         case 'ban':
  86.             if (!message.member.roles.find(r => r.name === "Administrating Team")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  87.                 .then(msg => msg.delete(5000));
  88.  
  89.             var user = message.mentions.users.first();
  90.  
  91.             if (user) {
  92.                 var member = message.guild.member(user);
  93.  
  94.                 if (member) {
  95.                     member.ban('You were banned!').then(() => {
  96.                         message.reply(`Succesfully kicked ${user.tag}`);
  97.                     }).catch(err => {
  98.                         message.reply('I was unable to kick the user');
  99.                         console.log(err);
  100.                     });
  101.                 } else {
  102.                     message.reply("That user isn\'t in this server")
  103.                 }
  104.             } else {
  105.                 message.reply('You need to specify a person!')
  106.             }
  107.             break;
  108.         case 'botinfo':
  109.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  110.                 .then(msg => msg.delete(5000));
  111.             let author = message.author.username;
  112.             let boticon = message.author.displayAvatarURL;
  113.             let botembed = new Discord.RichEmbed()
  114.  
  115.                 .setTitle("**Bot Information**")
  116.                 .setDescription("Made by press alt+f4#1684")
  117.                 .addField("Bot Name", bot.user.username)
  118.                 .addField("Info", bot.user.createdAt)
  119.                 .setColor(0xffbf43)
  120.                 .setThumbnail(boticon)
  121.                 .setAuthor(author)
  122.                 .setFooter("DM me to say thank you! XD")
  123.  
  124.             message.channel.send(botembed)
  125.  
  126.             break;
  127.  
  128.         case 'help':
  129.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  130.                 .then(msg => msg.delete(5000));
  131.             var commandicon = message.author.avatarURL;
  132.             var vversion = ('Shows the current version of the bot.')
  133.             var pping = ('Fun command (WIP)')
  134.             var uuserinfo = ('Shows the user information.')
  135.             var bbotinfo = ('Shows the bot information.')
  136.             var kkick = ('Kick a user.')
  137.             var bban = ('Ban a user.')
  138.             var hhelp = ('Shows this gui.')
  139.             var cclear = ('Purge or clear an channel!')
  140.  
  141.             var command = new Discord.RichEmbed()
  142.  
  143.                 .setTitle("**List of Commands**")
  144.                 .addField("!version", vversion)
  145.                 .addField("!ping", pping)
  146.                 .addField("!userinfo", uuserinfo)
  147.                 .addField("!botinfo", bbotinfo)
  148.                 .addField("!kick", kkick)
  149.                 .addField("!ban", bban)
  150.                 .addField("!help/cmds", hhelp)
  151.                 .addField("!clear [choose number between 1-100]", cclear)
  152.                 .setColor(0x00e5b8)
  153.                 .setThumbnail(commandicon)
  154.  
  155.             message.channel.send(command)
  156.  
  157.             break;
  158.         case 'cmds':
  159.             if (!message.member.roles.find(r => r.name === "Members")) return message.reply('*YOU DO NOT HAVE PERMISSIONS*')
  160.                 .then(msg => msg.delete(5000));
  161.             var ccommandicon = message.author.avatarURL;
  162.             var vvversion = ('Shows the current version of the bot.')
  163.             var ppping = ('Fun command (WIP)')
  164.             var uuuserinfo = ('Shows the user information.')
  165.             var bbbotinfo = ('Shows the bot information.')
  166.             var kkkick = ('Kick a user.')
  167.             var bbban = ('Ban a user.')
  168.             var hhhelp = ('Shows this gui.')
  169.             var ccclear = ('Purge or clear an channel!')
  170.  
  171.             var command = new Discord.RichEmbed()
  172.  
  173.                 .setTitle("**List of Commands**")
  174.                 .addField("!version", vvversion)
  175.                 .addField("!ping", ppping)
  176.                 .addField("!userinfo", uuuserinfo)
  177.                 .addField("!botinfo", bbbotinfo)
  178.                 .addField("!kick", kkkick)
  179.                 .addField("!ban", bbban)
  180.                 .addField("!help/cmds", hhhelp)
  181.                 .addField("!clear [choose number between 1-100]", ccclear)
  182.                 .setColor(0x00e5b8)
  183.                 .setThumbnail(ccommandicon)
  184.  
  185.             message.channel.send(command)
  186.  
  187.             break;
  188.  
  189.     }
  190.  
  191. });
  192.  
  193. bot.login(token);
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