From 7e49ce9a7be2ea3f1eaafc97cbc3ed8f609cef74 Mon Sep 17 00:00:00 2001 From: Neuro Assassin <42872277+NeuroAssassin@users.noreply.github.com> Date: Thu, 25 Apr 2019 11:57:26 -0400 Subject: [PATCH] [Mod] Remove error when unbanning an unknown user (#2619) Fix for #2542 --- redbot/cogs/mod/kickban.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/mod/kickban.py b/redbot/cogs/mod/kickban.py index df829d1d7..f595845bd 100644 --- a/redbot/cogs/mod/kickban.py +++ b/redbot/cogs/mod/kickban.py @@ -508,8 +508,9 @@ class KickBanMixin(MixinMeta): click the user and select 'Copy ID'.""" guild = ctx.guild author = ctx.author - user = await self.bot.fetch_user(user_id) - if not user: + try: + user = await self.bot.fetch_user(user_id) + except discord.errors.NotFound: await ctx.send(_("Couldn't find a user with that ID!")) return audit_reason = get_audit_reason(ctx.author, reason)