From a4d9aab979682d42adc512c5b66e7621512c2bd3 Mon Sep 17 00:00:00 2001 From: Frisk Date: Fri, 30 Aug 2024 10:26:55 +0200 Subject: [PATCH] Fix discussion issue for new wikis in the feed --- src/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bot.py b/src/bot.py index 676a229..b190d53 100644 --- a/src/bot.py +++ b/src/bot.py @@ -454,6 +454,8 @@ async def discussion_handler(): except: logger.exception("On loading json of response.") continue + if isinstance(discussion_feed, list) and any(discussion_feed) is False: + continue if db_wiki["postid"] is None: # new wiki, just get the last post to not spam the channel if len(discussion_feed) > 0: DBHandler.add(db_wiki["wiki"], discussion_feed[-1]["id"], True) @@ -463,8 +465,6 @@ async def discussion_handler(): continue comment_events = [] targets = await generate_targets(db_wiki["wiki"], "AND NOT postid = '-1'") - if isinstance(discussion_feed, list) and any(discussion_feed) is False: - continue for post in discussion_feed: if post["_embedded"]["thread"][0]["containerType"] == "ARTICLE_COMMENT" and post["id"] > db_wiki["postid"]: comment_events.append(post["forumId"])