toxic-debug7

This commit is contained in:
Untone 2024-09-26 20:43:56 +03:00
parent bf1d96b4c8
commit 6c1adf644c

View File

@ -42,10 +42,10 @@ async def messages_routing(msg, state):
msg_toxic_key = f"toxic:{cid}:{uid}:{scoring_msg_id}" msg_toxic_key = f"toxic:{cid}:{uid}:{scoring_msg_id}"
logger.debug('msg_toxic_key: ', msg_toxic_key) logger.debug('msg_toxic_key: ', msg_toxic_key)
one_score = await redis.get(msg_toxic_key) one_score = await redis.get(msg_toxic_key)
one_score = int(one_score[0]) msg_score = int(one_score[0])
logger.debug('one_score: ', one_score) logger.debug('one_score: ', one_score)
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"{one_score}% токсичности\nСредняя токсичность сообщений: {toxic_score}% {emoji}" text = f"{msg_score}% токсичности\nСредняя токсичность сообщений: {toxic_score}% {emoji}"
if text: if text:
await telegram_api( await telegram_api(
"sendMessage", "sendMessage",