- Check for 'attachments' key before counting attachments

- fix #177
This commit is contained in:
trigg 2021-10-20 19:56:54 +01:00
parent 2c3449f263
commit 1ba14dc950

View file

@ -220,7 +220,7 @@ class DiscordConnector:
return message["embeds"][0]["rawDescription"]
if "author" in message["embeds"][0]:
return message["embeds"][0]["author"]["name"]
elif len(message["attachments"]) == 1:
elif 'attachments' in message and len(message["attachments"]) == 1:
return ""
return ""