Haha-Yes/commands/admin/unban.js

40 lines
907 B
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2018-12-25 19:17:07 +01:00
2018-12-30 01:20:24 +01:00
class UnbanCommand extends Command {
2019-01-02 08:09:45 +01:00
constructor() {
super('unban', {
aliases: ['unban'],
category: 'admin',
args: [
{
id: 'member',
2019-12-30 14:56:05 +01:00
type: 'integer',
2019-06-23 03:41:59 +02:00
prompt: {
2019-11-15 21:39:53 +01:00
start: 'which member do you want to unban?',
2019-12-30 14:56:05 +01:00
retry: 'This doesn\'t look like an ID, please try again'
2019-06-23 03:41:59 +02:00
}
2019-01-02 08:09:45 +01:00
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
2020-03-19 23:24:31 +01:00
channel: 'guild',
2019-01-02 08:09:45 +01:00
description: {
content: 'unban users',
usage: '[user id]',
examples: ['267065637183029248']
}
});
}
2018-11-13 20:24:23 +01:00
2019-01-02 08:09:45 +01:00
async exec(message, args) {
2019-12-30 14:56:05 +01:00
message.guild.members.unban(args.member.toString())
.then(() => {
return message.reply('user was succesfully unbanned.');
})
.catch(() => {
return message.reply('Could not unban this user, is he banned in the first place?');
});
2019-01-02 08:09:45 +01:00
}
2018-12-30 01:20:24 +01:00
}
module.exports = UnbanCommand;