From edb5be3a2521ffe59a7aa2596bd6ea4c006afbd4 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Wed, 14 Oct 2020 16:06:53 +0200 Subject: [PATCH] Avoid dispatching when there's no feed updates (#173) * Avoid dispatching when there's no feed updates * version bump --- rss/rss.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rss/rss.py b/rss/rss.py index 2ab4026..f170acc 100644 --- a/rss/rss.py +++ b/rss/rss.py @@ -25,7 +25,7 @@ from .tag_type import INTERNAL_TAGS, VALID_IMAGES, TagType log = logging.getLogger("red.aikaterna.rss") -__version__ = "1.1.21" +__version__ = "1.1.22" class RSS(commands.Cog): @@ -872,6 +872,10 @@ class RSS(commands.Cog): log.debug(f"Couldn't match anything for feed {name} on cid {channel.id}, only posting 1 post") feedparser_plus_objects = [feedparser_plus_objects[0]] + if not feedparser_plus_objects: + # early-exit so that we don't dispatch when there's no updates + return + # post oldest first feedparser_plus_objects.reverse()