From 589041556ecd34946e878b4ba6524e7920f4efa3 Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Mon, 3 Sep 2018 17:01:48 -0800 Subject: [PATCH] [Streams] Fix excessive writes to config (#2095) Resolves #2052. --- redbot/cogs/streams/streams.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbot/cogs/streams/streams.py b/redbot/cogs/streams/streams.py index 51973ec4a..f537ce026 100644 --- a/redbot/cogs/streams/streams.py +++ b/redbot/cogs/streams/streams.py @@ -508,6 +508,8 @@ class Streams: try: embed = await stream.is_online() except OfflineStream: + if not stream._messages_cache: + continue for message in stream._messages_cache: try: autodelete = await self.db.guild(message.guild).autodelete() @@ -558,6 +560,8 @@ class Streams: print(_("The Community {} was not found!").format(community.name)) continue except OfflineCommunity: + if not community._messages_cache: + continue for message in community._messages_cache: try: autodelete = await self.db.guild(message.guild).autodelete()