ninja-gen

hackban.js

Jan 15th, 2020
68
0
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 customisation = require('../customisation.json');
  4. exports.run = (client, message, args) => {
  5.   let reason = args.slice(1).join(' ');
  6.   let user = args[0];
  7.   //let logchannel = message.guild.channels.find('name', 'logs');
  8.   //if (!logchannel) return message.channel.send('I cannot find a logs channel');
  9.   if (args[0] === message.author.id) return message.reply('I can\' let you do that, self-harm is bad:facepalm:');
  10.   if (user === client.user.id) return message.reply("You pleblord, how can you use a bot to ban itself?:joy:");
  11.   if (args[0] === "510065483693817867") return message.reply("You can't ban my Developer:wink:");
  12.   if (!message.member.hasPermission("BAN_MEMBERS")) return message.reply(":no_entry_sign: **Error:** You don't have the **Ban Members** permission!");
  13.   if (!user) return message.reply('You need to input a User ID');
  14.  
  15.   if (reason.length < 1) {reason = 'No reason supplied.'};
  16.   message.guild.ban(user).catch(e =>{
  17.     if (e) return message.channel.send("That user has already been banned or I don't have permission or my role isn't high enough!");
  18.   });
  19.  
  20.   const embed = new Discord.RichEmbed()
  21.     .setColor(0xFF0000)
  22.     .setTimestamp()
  23.     .addField('Action:', 'HackBan')
  24.     .addField('User:', `${args[0]}`)
  25.     .addField('Moderator:', `${message.author.username}#${message.author.discriminator}`)
  26.     .addField('Reason', reason)
  27.     .setFooter("© Toxic Bot | By ☣ Tσxιƈ Dҽʋ ☣");
  28.    
  29.     let logchannel = message.guild.channels.find('name', 'toxic-modlogs');
  30.     if  (!logchannel){
  31.       message.channel.send(`:hammer: Done. You don't have to worry about that shit head anymore, I have banned them!`)
  32.      message.channel.send({embed})
  33.  }else{
  34.    message.channel.send(`:hammer:  Done. You don't have to worry about that shit head anymore, I have banned them! Also I\'ve logged the ban in <#${logchannel.id}>.`)
  35.    client.channels.get(logchannel.id).send({embed});
  36.  }
  37. };
  38.  
  39. exports.conf = {
  40.  enabled: true,
  41.  guildOnly: false,
  42.  aliases: ["hb",],
  43.  permLevel: 2
  44. };
  45.  
  46. exports.help = {
  47.  name: 'hackban',
  48.  description: 'Forcebans a user.',
  49.  usage: 'hackban [user id] [reason]'
  50. };
Add Comment
Please, Sign In to add comment