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"])