Fix KeyError for cached messages from deleted channels in Streams

* Merge pull request #5031

* Fix KeyError for cached messages from deleted channels in Streams
This commit is contained in:
jack1142 2021-05-19 15:03:28 +02:00 committed by GitHub
parent 01f86091ab
commit 9b66d19369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,8 +80,10 @@ class Stream:
channel = guild and guild.get_channel(msg_data["channel"]) channel = guild and guild.get_channel(msg_data["channel"])
else: else:
channel = self._bot.get_channel(msg_data["channel"]) 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 yield data
def export(self): def export(self):