less-norm
This commit is contained in:
parent
a2545217e8
commit
5606c69035
|
@ -57,7 +57,7 @@ async def messages_routing(msg, state):
|
|||
if one_score:
|
||||
logger.debug(one_score)
|
||||
reply_text += f"{int(one_score)}% токсичности\n"
|
||||
|
||||
try:
|
||||
# count average between all of messages
|
||||
toxic_pattern = f"toxic:{cid}:{uid}:*"
|
||||
toxic_score = await get_average_pattern(toxic_pattern)
|
||||
|
@ -77,6 +77,9 @@ async def messages_routing(msg, state):
|
|||
reply_text += (
|
||||
f"Средняя токсичность сообщений: {toxic_score}% {emoji}"
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
if reply_text:
|
||||
await telegram_api(
|
||||
"sendMessage",
|
||||
|
|
Loading…
Reference in New Issue
Block a user