From fa40182f2e5a29dead645e0b4dfd1142fd6a4fa3 Mon Sep 17 00:00:00 2001 From: geirawsm Date: Tue, 24 Dec 2024 11:33:50 +0100 Subject: [PATCH] Fixed `scrap_ fcb_news` after get_output > dict --- sausage_bot/cogs/scrape_fcb_news.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sausage_bot/cogs/scrape_fcb_news.py b/sausage_bot/cogs/scrape_fcb_news.py index 1e9f3c1..dd0d566 100755 --- a/sausage_bot/cogs/scrape_fcb_news.py +++ b/sausage_bot/cogs/scrape_fcb_news.py @@ -180,12 +180,20 @@ async def get_tasks(): task_list = await get_tasks() for task in task_list: log.debug(f'checking task: {task}') - if task[0] == 'post_news': - if task[1] == 'started': - log.debug(f'`{task[0]}` is set as `{task[1]}`, starting...') + if task['task'] == 'post_news': + if task['status'] == 'started': + log.debug( + '`{}` is set as `{}`, stopping...'.format( + task['task'], task['status'] + ) + ) scrape_and_post.post_fcb_news.start() - elif task[1] == 'stopped': - log.debug(f'`{task[0]}` is set as `{task[1]}`') + elif task['status'] == 'stopped': + log.debug( + '`{}` is set as `{}`, starting...'.format( + task['task'], task['status'] + ) + ) scrape_and_post.post_fcb_news.cancel()