From 8e527db05f725711ed139e13d148c3c21d45f343 Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 11 Dec 2018 00:08:51 +0100 Subject: [PATCH] Fix timeout handling in TW import --- src/pluralkit/bot/commands/import_commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pluralkit/bot/commands/import_commands.py b/src/pluralkit/bot/commands/import_commands.py index 4a93f2c1..802bd836 100644 --- a/src/pluralkit/bot/commands/import_commands.py +++ b/src/pluralkit/bot/commands/import_commands.py @@ -42,9 +42,11 @@ async def import_tupperware(ctx: CommandContext): tupperware_page_embeds = [] - tw_msg: discord.Message = await ctx.client.wait_for("message", check=ensure_account, timeout=60.0 * 5) - if not tw_msg: + try: + tw_msg: discord.Message = await ctx.client.wait_for("message", check=ensure_account, timeout=60.0 * 5) + except asyncio.TimeoutError: raise CommandError("Tupperware import timed out.") + tupperware_page_embeds.append(tw_msg.embeds[0].to_dict()) # Handle Tupperware pagination