diff options
| author | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
| commit | bb511abc03bb66848947e37a999502b813c77269 (patch) | |
| tree | 612c010fc8317e1cdf11471a18aad0270819d33e /server/src/commands/mod/Unban.ts | |
| parent | fix: if clear amount equal or over 100, round down to 99 (diff) | |
| download | dep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz dep-core-bb511abc03bb66848947e37a999502b813c77269.zip | |
goodbye old uwufier :cry:
Diffstat (limited to 'server/src/commands/mod/Unban.ts')
| -rw-r--r-- | server/src/commands/mod/Unban.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/server/src/commands/mod/Unban.ts b/server/src/commands/mod/Unban.ts new file mode 100644 index 0000000..7e66af1 --- /dev/null +++ b/server/src/commands/mod/Unban.ts @@ -0,0 +1,38 @@ +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<Message> { + 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?')}); + } +}
\ No newline at end of file |