From b8fa684cb916ad8bba19f26fed4202fa00882989 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 30 Dec 2019 14:56:05 +0100 Subject: [PATCH] fix unban command --- commands/admin/unban.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/commands/admin/unban.js b/commands/admin/unban.js index 9bb6559..c2eb1a3 100644 --- a/commands/admin/unban.js +++ b/commands/admin/unban.js @@ -8,9 +8,10 @@ class UnbanCommand extends Command { args: [ { id: 'member', - type: 'member', + type: 'integer', prompt: { start: 'which member do you want to unban?', + retry: 'This doesn\'t look like an ID, please try again' } } ], @@ -26,8 +27,13 @@ class UnbanCommand extends Command { } async exec(message, args) { - message.guild.unban(args.member) - .then(() => message.reply('user was succesfully unbanned.')); + 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?'); + }); } }