diff --git a/redbot/cogs/mod/mod.py b/redbot/cogs/mod/mod.py index 09e0ecb36..5ce445126 100644 --- a/redbot/cogs/mod/mod.py +++ b/redbot/cogs/mod/mod.py @@ -436,7 +436,8 @@ class Mod: using this command""" author = ctx.author guild = ctx.guild - + if not guild.me.guild_permissions.ban_members: + return await ctx.send(_("I lack the permissions to do this.")) is_banned = False ban_list = await guild.bans() for entry in ban_list: @@ -449,8 +450,10 @@ class Mod: return user = guild.get_member(user_id) - if user is None: - user = discord.Object(id=user_id) # User not in the guild, but + if user is not None: + # Instead of replicating all that handling... gets attr from decorator + return await ctx.invoke(self.ban, user, None, reason=reason) + user = discord.Object(id=user_id) # User not in the guild, but audit_reason = get_audit_reason(author, reason) queue_entry = (guild.id, user_id)