removed-fix4
This commit is contained in:
parent
03db470b76
commit
fe3b53329d
|
@ -39,7 +39,7 @@ async def messages_routing(msg, state):
|
||||||
scr = int(await redis.get(key))
|
scr = int(await redis.get(key))
|
||||||
scores.append(scr)
|
scores.append(scr)
|
||||||
toxic_score = math.floor(sum(scores)/len(scores)) if scores else 0
|
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}")
|
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 '😇'
|
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}"
|
text = f"{int(one_score)}% токсичности\nСредняя токсичность сообщений: {toxic_score}% {emoji}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user