import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; export default class UnbanMod extends Command { public constructor() { super('unban', { aliases: ['unban'], category: 'moderation', description: { content: 'Unban a specified user from the server.', usage: '[user id]', examples: [ '50' ] }, ratelimit: 3, channel: 'guild', clientPermissions: ['BAN_MEMBERS'], userPermissions: ['BAN_MEMBERS'], args: [ { id: 'user', type: 'integer', prompt: { start: 'Which user would you like to unban?', retry: 'That doesn\' seem to be a user ID, please try again!' } } ] }); } public exec(msg: Message, { user }): Promise { return msg.guild.members.unban(user.toString()) // Does this really need to be returned? .then(() => { return msg.reply(`User ID ${user} was successfully unbanned!`)}) .catch(() => { return msg.reply('Could not unban the specified user, are they banned in the first place?')}); } }