[MassUnban] Skip empty ban reasons

This commit is contained in:
aikaterna
2021-09-30 16:18:06 -07:00
parent b4e6550aa6
commit 3c89fcf463

View File

@@ -66,6 +66,8 @@ class MassUnban(commands.Cog):
return await ctx.send("Response timed out. Please run this command again if you wish to try again.") return await ctx.send("Response timed out. Please run this command again if you wish to try again.")
else: else:
for ban_entry in banlist: for ban_entry in banlist:
if not ban_entry.reason:
continue
if ban_reason.lower() in ban_entry.reason.lower(): if ban_reason.lower() in ban_entry.reason.lower():
await ctx.guild.unban(ban_entry.user, reason=f"Mass Unban requested by {str(ctx.author)} ({ctx.author.id})") await ctx.guild.unban(ban_entry.user, reason=f"Mass Unban requested by {str(ctx.author)} ({ctx.author.id})")
await asyncio.sleep(0.5) await asyncio.sleep(0.5)