From a9b8125cc108824d6221686e469075dfae48dd0a Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Fri, 21 Mar 2025 15:17:57 +0300 Subject: [PATCH] Enhance emoji handling in PostParser by replacing None or empty emojis with a question mark character in reaction displays --- post_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post_parser.py b/post_parser.py index c5c7bf5..12e1a8b 100644 --- a/post_parser.py +++ b/post_parser.py @@ -555,7 +555,11 @@ class PostParser: views_html = "" if reactions := getattr(message, "reactions", None): for reaction in reactions.reactions: - reactions_html += f'{reaction.emoji} {reaction.count}  ' + # Replace None or empty emoji with replacement character + emoji = reaction.emoji + if emoji is None or emoji == "None" or emoji == "": + emoji = "�" # Question mark as replacement for missing emojis + reactions_html += f'{emoji} {reaction.count}  ' reactions_html = reactions_html.rstrip() if views := getattr(message, "views", None):