From aa6e6eaa3a67d9f956b55c34413e036b111781d3 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 13 Nov 2022 07:54:53 +1100 Subject: [PATCH] Fix a bug where we try to fetch emote "" for messages with no emotes --- chat_archiver/chat_archiver/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat_archiver/chat_archiver/main.py b/chat_archiver/chat_archiver/main.py index 8df8b67..52fc079 100644 --- a/chat_archiver/chat_archiver/main.py +++ b/chat_archiver/chat_archiver/main.py @@ -214,7 +214,7 @@ class Archiver(object): self.logger.debug("Got message: {}".format(data)) messages_received.labels(channel=self.channel, client=id(self), command=message.command).inc() - if data['tags'] and 'emotes' in data['tags']: + if data.get('tags', {}).get('emotes', '') != '': emote_specs = data['tags']['emotes'].split('/') emote_ids = [emote_spec.split(':')[0] for emote_spec in emote_specs] ensure_emotes(self.base_dir, emote_ids)