toxic-score-reply
This commit is contained in:
@@ -33,19 +33,13 @@ async def messages_routing(msg, state):
|
|||||||
|
|
||||||
elif bool(text):
|
elif bool(text):
|
||||||
mid = msg.get("message_id")
|
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(
|
await telegram_api(
|
||||||
"sendMessage",
|
"sendMessage",
|
||||||
chat_id=cid,
|
chat_id=cid,
|
||||||
reply_to_message_id=mid,
|
reply_to_message_id=rmsg,
|
||||||
text=f"{latest_toxic.get(cid, 0)}% токсичности"
|
text=f"{latest_toxic.get(f"{cid}:{rmsg}", 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)}% токсичности"
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
toxic_score = detector(text)
|
toxic_score = detector(text)
|
||||||
|
Reference in New Issue
Block a user