This commit is contained in:
2024-09-26 18:31:32 +03:00
parent 3b593fe8c7
commit 7a967cb955
2 changed files with 3 additions and 2 deletions

View File

@@ -43,7 +43,8 @@ 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
text = f"Доброе утро! Средняя токсичность твоих сообщений: {toxic_score}%"
emoji = '🙏' if toxic_score < 3 else
text = f"Доброе утро! Средняя токсичность твоих сообщений: {toxic_score}% {emoji}"
else:
latest_toxic_message_id = await redis.get(f"toxic:{cid}")
scoring_msg_id = reply_msg.get("message_id") or int(latest_toxic_message_id)