From 86dc07d64b8dda9e3bf0ab440bb5295935c9a771 Mon Sep 17 00:00:00 2001 From: Holly Date: Tue, 9 Mar 2021 07:09:39 +0000 Subject: [PATCH] Slightly more resilient against crashing due to events I don't know how to handle --- mtgcardlookup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mtgcardlookup.py b/mtgcardlookup.py index c998b46..9c40f50 100755 --- a/mtgcardlookup.py +++ b/mtgcardlookup.py @@ -108,15 +108,15 @@ async def listen(c, me): # two events come in for the statuses, one of them has the status nested deeper # just ignore that one if 'status' in status: continue + + status_id = status['id'] + status_author = '@' + status['account']['acct'] + status_text = status['content'] + status_visibility = status['visibility'] except: # ignore any events we don't know how to handle continue - status_id = status['id'] - status_author = '@' + status['account']['acct'] - status_text = status['content'] - status_visibility = status['visibility'] - reply_visibility = min(('unlisted', status_visibility), key=['direct', 'private', 'unlisted', 'public'].index) media_ids = None