stability-patch2
This commit is contained in:
parent
d156c10855
commit
eff5cdb394
|
@ -59,8 +59,11 @@ async def messages_routing(msg, state):
|
|||
# current mesasage toxicity
|
||||
if reply_to_msg_id:
|
||||
one_score = await redis.get(f"toxic:{cid}:{uid}:{reply_to_msg_id}")
|
||||
reply_text = ''
|
||||
if one_score:
|
||||
logger.debug(one_score)
|
||||
reply_text += f"{int(one_score)}% токсичности\n"
|
||||
if toxic_score:
|
||||
emoji = (
|
||||
"😳"
|
||||
if toxic_score > 90
|
||||
|
@ -72,14 +75,13 @@ async def messages_routing(msg, state):
|
|||
if toxic_score > 20
|
||||
else "😇"
|
||||
)
|
||||
text = f"{int(one_score)}% токсичности\n"
|
||||
if toxic_score:
|
||||
text += "Средняя токсичность сообщений: {toxic_score}% {emoji}"
|
||||
reply_text += "Средняя токсичность сообщений: {toxic_score}% {emoji}"
|
||||
if reply_text:
|
||||
await telegram_api(
|
||||
"sendMessage",
|
||||
chat_id=cid,
|
||||
reply_to_message_id=reply_to_msg_id,
|
||||
text=text,
|
||||
text=reply_text,
|
||||
)
|
||||
try:
|
||||
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
||||
|
|
Loading…
Reference in New Issue
Block a user