From fe3b53329de924b3c4ab69b9e48d86a5be5ac9b5 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 26 Sep 2024 18:55:16 +0300 Subject: [PATCH] removed-fix4 --- handlers/messages_routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/messages_routing.py b/handlers/messages_routing.py index 67d82d2..12386ef 100644 --- a/handlers/messages_routing.py +++ b/handlers/messages_routing.py @@ -39,7 +39,7 @@ async def messages_routing(msg, state): scr = int(await redis.get(key)) scores.append(scr) toxic_score = math.floor(sum(scores)/len(scores)) if scores else 0 - scoring_msg_id = reply_msg.get("message_id") or int(latest_toxic_message_id) + scoring_msg_id = reply_msg.get("message_id", int(latest_toxic_message_id)) if reply_msg else int(latest_toxic_message_id) one_score = await redis.get(f"toxic:{cid}:{uid}:{scoring_msg_id}") emoji = '😳' if toxic_score > 90 else '😟' if toxic_score > 80 else '😏' if toxic_score > 60 else '🙂' if toxic_score > 20 else '😇' text = f"{int(one_score)}% токсичности\nСредняя токсичность сообщений: {toxic_score}% {emoji}"