tweak matching & remove "no pkg" message

pull/1/head
Matt C 3 years ago
parent fb1a651284
commit d6482afdbd

@ -93,20 +93,15 @@ class RSS(commands.Cog):
self.dolog("Updated cache") self.dolog("Updated cache")
d = feedparser.parse(new) d = feedparser.parse(new)
hadNew = False
for item in d.entries: for item in d.entries:
pkgn = str(item['title'])
if " " in pkgn:
pkgn = pkgn.split(" ")[0]
for tgt in self.package_names: for tgt in self.package_names:
if tgt in str(item['title']): if tgt in pkgn:
await self.send("Package change: `" + str(item['title']) + "`") await self.send("Package change: `" + str(item['title']) + "`")
hadNew = True
break 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: except Exception as e:
syslog.log("RSS ERROR", str(e)) syslog.log("RSS ERROR", str(e))

Loading…
Cancel
Save