From 9b66d19369bb07af60ebe6526da4912dbc3a9a29 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Wed, 19 May 2021 15:03:28 +0200 Subject: [PATCH] Fix KeyError for cached messages from deleted channels in Streams * Merge pull request #5031 * Fix KeyError for cached messages from deleted channels in Streams --- redbot/cogs/streams/streamtypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/streams/streamtypes.py b/redbot/cogs/streams/streamtypes.py index 7a49df831..202e4a84f 100644 --- a/redbot/cogs/streams/streamtypes.py +++ b/redbot/cogs/streams/streamtypes.py @@ -80,8 +80,10 @@ class Stream: channel = guild and guild.get_channel(msg_data["channel"]) else: channel = self._bot.get_channel(msg_data["channel"]) - if channel is not None: - data["partial_message"] = channel.get_partial_message(data["message"]) + + data["partial_message"] = ( + channel.get_partial_message(data["message"]) if channel is not None else None + ) yield data def export(self):