You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/admin/unban.js

40 lines
907 B
JavaScript

const { Command } = require('discord-akairo');
5 years ago
class UnbanCommand extends Command {
5 years ago
constructor() {
super('unban', {
aliases: ['unban'],
category: 'admin',
args: [
{
id: 'member',
type: 'integer',
5 years ago
prompt: {
5 years ago
start: 'which member do you want to unban?',
retry: 'This doesn\'t look like an ID, please try again'
5 years ago
}
5 years ago
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
channel: 'guild',
5 years ago
description: {
content: 'unban users',
usage: '[user id]',
examples: ['267065637183029248']
}
});
}
6 years ago
5 years ago
async exec(message, args) {
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?');
});
5 years ago
}
}
module.exports = UnbanCommand;