toxic-score-reply-fix2
This commit is contained in:
parent
6129d2fab8
commit
6d1372fd7f
|
@ -33,8 +33,8 @@ async def messages_routing(msg, state):
|
|||
|
||||
elif bool(text):
|
||||
mid = msg.get("message_id")
|
||||
if reply_msg and text == '/score@welcomecenter_bot':
|
||||
rmsg = reply_msg.get("message_id")
|
||||
if text == '/score@welcomecenter_bot':
|
||||
rmsg = reply_msg.get("message_id", latest_toxic[cid])
|
||||
await telegram_api(
|
||||
"sendMessage",
|
||||
chat_id=cid,
|
||||
|
@ -49,7 +49,7 @@ async def messages_routing(msg, state):
|
|||
else:
|
||||
toxic_score = detector(text)
|
||||
toxic_perc = math.floor(toxic_score*100)
|
||||
latest_toxic[cid] = toxic_perc
|
||||
latest_toxic[cid] = mid
|
||||
latest_toxic[f"{cid}:{mid}"] = toxic_perc
|
||||
logger.info(f'\ntext: {text}\ntoxic: {toxic_perc}%')
|
||||
if toxic_score > 0.81:
|
||||
|
|
Loading…
Reference in New Issue
Block a user