From 71c2d4fd8c32fa16dbfe57109e2bfbc35931ae16 Mon Sep 17 00:00:00 2001 From: Frisk Date: Fri, 14 Aug 2020 23:38:26 +0200 Subject: [PATCH] Various fixes based on recent crash --- src/bot.py | 4 ++-- src/discord.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bot.py b/src/bot.py index b9b0890..dceaddc 100644 --- a/src/bot.py +++ b/src/bot.py @@ -320,7 +320,7 @@ async def discussion_handler(): try: while True: fetch_all = db_cursor.execute( - 'SELECT wiki, wikiid, postid FROM rcgcdw WHERE wikiid IS NOT NULL') + 'SELECT wiki, wikiid, rcid, postid FROM rcgcdw WHERE wikiid IS NOT NULL') for db_wiki in fetch_all.fetchall(): header = settings["header"] header["Accept"] = "application/hal+json" @@ -441,7 +441,7 @@ async def main_loop(): await asyncio.gather(main_tasks["wiki_scanner"], main_tasks["discussion_handler"], main_tasks["message_sender"]) except KeyboardInterrupt: shutdown(loop) - except asyncio.exceptions.CancelledError: + except asyncio.CancelledError: return asyncio.run(main_loop(), debug=False) diff --git a/src/discord.py b/src/discord.py index 07da73c..5584718 100644 --- a/src/discord.py +++ b/src/discord.py @@ -113,7 +113,7 @@ async def generic_msg_sender_exception_logger(exception: str, title: str, **kwar message = DiscordMessage("embed", "bot/exception", [None], wiki=None) message["description"] = exception message["title"] = title - for key, value in kwargs: + for key, value in kwargs.items(): message.add_field(key, value) message.finish_embed() await send_to_discord_webhook_monitoring(message)