From a8efc0f01f5be4fd2215169df87c1cc9db320789 Mon Sep 17 00:00:00 2001 From: ascpial Date: Sat, 11 Mar 2023 20:26:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(ban):=20better=20?= =?UTF-8?q?check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/ban/ban.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ban/ban.py b/plugins/ban/ban.py index 10ea78ae..01cecb3c 100644 --- a/plugins/ban/ban.py +++ b/plugins/ban/ban.py @@ -264,9 +264,9 @@ async def fake_ban( show_error: whether to show an error message if the ban fails """ - try: + if isinstance(ctx.channel, discord.Thread): channel = ctx.channel.parent - except AttributeError: + else: channel = ctx.channel # send the invitation to allow the user to rejoin the guild