Slightly more resilient against crashing due to events I don't know how to handle

This commit is contained in:
Holly 2021-03-09 07:09:39 +00:00
parent f84360398e
commit 86dc07d64b
1 changed files with 5 additions and 5 deletions

View File

@ -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