From d0878c0af037ebc1b660cc19d9e81360ef51cf23 Mon Sep 17 00:00:00 2001 From: ente Date: Fri, 17 Jun 2022 22:44:59 +0200 Subject: [PATCH] Fixed: Emojis in poll texts will be counted as well --- miceco.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/miceco.py b/miceco.py index 1ca4077..67f38a0 100755 --- a/miceco.py +++ b/miceco.py @@ -196,11 +196,20 @@ for element in noteList: emojiList[index]["count"] += element["cw"].count(emojiList[index]["emoji"]) # Count those Emojis, that # are in this note CW text + if "poll" in element: + for pollchoice in element["poll"]["choices"]: + emojiList[index]["count"] += pollchoice["text"].count(emojiList[index]["emoji"]) # CCount custom emojis that are used in poll texts + # Process UTF8 Emojis if element["cw"] is not None: UTF8text = element["text"] + " " + element["cw"] else: UTF8text = element["text"] + + if "poll" in element: + for pollchoice in element["poll"]["choices"]: + UTF8text += " " + pollchoice["text"] + UTF8ListRaw = emojilib.distinct_emoji_list(UTF8text) # Find all UTF8 Emojis in Text and CW text UTF8text = emojilib.demojize(UTF8text) if len(UTF8ListRaw) > 0: