From 1542a8dd40797fa2c77530368a69685af3344dfb Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 14 Jul 2018 00:34:24 +0200 Subject: [PATCH] Fix timeouts on deletion confirmations --- bot/pluralkit/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/pluralkit/commands.py b/bot/pluralkit/commands.py index e876aee7..3dd384fc 100644 --- a/bot/pluralkit/commands.py +++ b/bot/pluralkit/commands.py @@ -214,7 +214,7 @@ async def system_delete(conn, message, args): await client.send_message(message.channel, "Are you sure you want to delete your system? If so, reply to this message with the system's ID (`{}`).".format(system["hid"])) msg = await client.wait_for_message(author=message.author, channel=message.channel, timeout=60.0) - if msg.content == system["hid"]: + if msg and msg.content == system["hid"]: await db.remove_system(conn, system_id=system["id"]) return True, "System deleted." else: @@ -356,7 +356,7 @@ async def member_delete(conn, message, member, args): await client.send_message(message.channel, "Are you sure you want to delete {}? If so, reply to this message with the member's ID (`{}`).".format(member["name"], member["hid"])) msg = await client.wait_for_message(author=message.author, channel=message.channel, timeout=60.0) - if msg.content == member["hid"]: + if msg and msg.content == member["hid"]: await db.delete_member(conn, member_id=member["id"]) return True, "Member deleted." else: