From d6482afdbdb776ae5c55910742ddefdd825c0f8a Mon Sep 17 00:00:00 2001 From: Matt C Date: Wed, 22 Dec 2021 11:12:37 -0500 Subject: [PATCH] tweak matching & remove "no pkg" message --- cogs/rss.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cogs/rss.py b/cogs/rss.py index d6715e3..e824506 100644 --- a/cogs/rss.py +++ b/cogs/rss.py @@ -93,20 +93,15 @@ class RSS(commands.Cog): self.dolog("Updated cache") d = feedparser.parse(new) - hadNew = False for item in d.entries: + pkgn = str(item['title']) + if " " in pkgn: + pkgn = pkgn.split(" ")[0] for tgt in self.package_names: - if tgt in str(item['title']): + if tgt in pkgn: await self.send("Package change: `" + str(item['title']) + "`") - hadNew = True break - - if not hadNew: - await self.send("No package changes to report :)") - - else: - await self.send("No package changes to report :)") except Exception as e: syslog.log("RSS ERROR", str(e))