Haha-Yes/commands/admin/ban.js

28 lines
No EOL
908 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class BanCommand extends Command {
constructor(client) {
super(client, {
name: 'ban',
group: 'admin',
memberName: 'ban',
description: 'ban the mentionned user',
guildOnly: true,
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
args: [
{
key: 'member',
prompt: 'Wich member would you like to ban?',
type: 'member',
}
]
});
}
async run(message, { member }) {
if(member.id === message.author.id)
return message.say("Why would you ban yourself ?")
member.ban()
.then(() => message.reply(`${member.user.username} was succesfully banned.`));
};
};