toxic-score-reply

This commit is contained in:
2024-09-26 16:11:14 +03:00
parent a38c6364eb
commit 368dcd0d31

View File

@@ -33,19 +33,13 @@ async def messages_routing(msg, state):
elif bool(text):
mid = msg.get("message_id")
if text == '/score@welcomecenter_bot':
if reply_msg and text == '/score@welcomecenter_bot':
rmsg = reply_msg.get("message_id")
await telegram_api(
"sendMessage",
chat_id=cid,
reply_to_message_id=mid,
text=f"{latest_toxic.get(cid, 0)}% токсичности"
)
elif text == '/score' and reply_to:
await telegram_api(
"re",
chat_id=cid,
reply_to_message_id=mid,
text=f"{latest_toxic.get(f"{cid}:{reply_msg.get("message_id")}", 0)}% токсичности"
reply_to_message_id=rmsg,
text=f"{latest_toxic.get(f"{cid}:{rmsg}", 0)}% токсичности"
)
else:
toxic_score = detector(text)