diff options
| author | 2020-07-23 14:39:01 +0800 | |
|---|---|---|
| committer | 2020-07-23 14:39:01 +0800 | |
| commit | 53fe5d44f2a44a2102d00d29c73b4cde733f9f26 (patch) | |
| tree | 3164cf7372ff4651213fd381cd605ae946ab9c99 | |
| parent | Merge pull request #957 from ks129/jam-test (diff) | |
Check that embed desc is not Empty before stripping.
| -rw-r--r-- | bot/cogs/help_channels.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 0c8cbb417..e0fd06654 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -428,8 +428,11 @@ class HelpChannels(commands.Cog): if not message or not message.embeds: return False - embed = message.embeds[0] - return message.author == self.bot.user and embed.description.strip() == description.strip() + bot_msg_desc = message.embeds[0].description + if bot_msg_desc is discord.Embed.Empty: + log.trace("Last message was a bot embed but it was empty.") + return False + return message.author == self.bot.user and bot_msg_desc.strip() == description.strip() @staticmethod def is_in_category(channel: discord.TextChannel, category_id: int) -> bool: |