From 73e329ee948faac712bbc827898eadb494d500f0 Mon Sep 17 00:00:00 2001 From: Conatum Date: Wed, 22 Dec 2021 08:14:32 +0200 Subject: [PATCH] fix (LionModule): Fix channel existence ward. Fixes an issue where all commands would fail in DMs. --- bot/LionModule.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/LionModule.py b/bot/LionModule.py index c1fd7256..6e89cf5e 100644 --- a/bot/LionModule.py +++ b/bot/LionModule.py @@ -81,15 +81,15 @@ class LionModule(Module): pass raise SafeCancellation(details="Module '{}' is not ready.".format(self.name)) - # Check that the channel and guild still exists - if not ctx.client.get_guild(ctx.guild.id) or not ctx.guild.get_channel(ctx.ch.id): - raise SafeCancellation(details='Command channel is no longer reachable.') - # Check global user blacklist if ctx.author.id in ctx.client.objects['blacklisted_users']: raise SafeCancellation(details='User is blacklisted.') if ctx.guild: + # Check that the channel and guild still exists + if not ctx.client.get_guild(ctx.guild.id) or not ctx.guild.get_channel(ctx.ch.id): + raise SafeCancellation(details='Command channel is no longer reachable.') + # Check global guild blacklist if ctx.guild.id in ctx.client.objects['blacklisted_guilds']: raise SafeCancellation(details='Guild is blacklisted.')