From 02d5df63a1ce4997db62521ab47d7ec6a11677f1 Mon Sep 17 00:00:00 2001 From: SylteA Date: Mon, 4 Mar 2024 19:17:02 +0100 Subject: [PATCH] Fix 'Unknown Message' error --- bot/extensions/polls/events.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/extensions/polls/events.py b/bot/extensions/polls/events.py index 220d641b..3fdca9fa 100644 --- a/bot/extensions/polls/events.py +++ b/bot/extensions/polls/events.py @@ -14,7 +14,11 @@ def __init__(self, bot: core.DiscordBot): @commands.Cog.listener() async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent): channel: discord.TextChannel = self.bot.get_channel(payload.channel_id) - message: discord.Message = await channel.fetch_message(payload.message_id) + + try: + message: discord.Message = await channel.fetch_message(payload.message_id) + except discord.NotFound: + return if payload.user_id == self.bot.user.id: return