diff --git a/slack2discord/parser.py b/slack2discord/parser.py index 2ed34a6..460aaf6 100644 --- a/slack2discord/parser.py +++ b/slack2discord/parser.py @@ -477,7 +477,17 @@ def parse_message(self, message, filename, channel_msgs_dict): if 'files' in message: for file in message['files']: - parsed_message.add_file(file) + if file.get('mode') == 'tombstone': + # File was deleted from Slack, just log this, + # don't bother mentioning this state in the Discord import. + if 'date_deleted' in file: + logger.warning("Attached file was deleted at" + f" {SlackParser.format_time(file['date_deleted'])}. Ignoring.") + else: + logger.warning(f"Attached file was deleted. Ignoring.") + else: + # Normal attached file case + parsed_message.add_file(file) if 'replies' in message: # this is the head of a thread