From 53fe5d44f2a44a2102d00d29c73b4cde733f9f26 Mon Sep 17 00:00:00 2001 From: kosayoda Date: Thu, 23 Jul 2020 14:39:01 +0800 Subject: Check that embed desc is not Empty before stripping. --- bot/cogs/help_channels.py | 7 +++++-- 1 file 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: -- cgit v1.2.3