diff options
| author | 2020-05-01 17:26:56 +0300 | |
|---|---|---|
| committer | 2020-05-01 17:26:56 +0300 | |
| commit | 5e55a34f3a3edcb041e6ea876055c7e593c707cc (patch) | |
| tree | 3f77d8a90f36d2c8ef06d3b4555abd986ec3b6d3 | |
| parent | Added on cog unload news posting tasks canceling on `News` cog (diff) | |
Added ignoring maillist when no recent threads (this month) in `News` cog
| -rw-r--r-- | bot/cogs/news.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/news.py b/bot/cogs/news.py index ecc8edaf3..ff2277283 100644 --- a/bot/cogs/news.py +++ b/bot/cogs/news.py @@ -125,6 +125,10 @@ class News(Cog): async with self.bot.http_session.get(RECENT_THREADS_TEMPLATE.format(name=maillist)) as resp: recents = BeautifulSoup(await resp.text(), features="lxml") + # When response have <p>, this mean that no threads available + if recents.p: + continue + for thread in recents.html.body.div.find_all("a", href=True): # We want only these threads that have identifiers if "latest" in thread["href"]: |