routing-fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
import math
|
||||
|
||||
from store import redis
|
||||
from bot.api import telegram_api
|
||||
from bot.config import FEEDBACK_CHAT_ID
|
||||
from nlp.toxicity_detector import detector
|
||||
@@ -36,8 +36,9 @@ async def messages_routing(msg, state):
|
||||
logger.info(f'\ntext: {text}\ntoxic: {math.floor(toxic_score*100)}%')
|
||||
if toxic_score > 0.71:
|
||||
if toxic_score > 0.85:
|
||||
await redis.execute("SET", f"removed:{uid}:{cid}:{mid}", text)
|
||||
await telegram_api(
|
||||
"deletemessage",
|
||||
"deleteMessage",
|
||||
chat_id=cid,
|
||||
message_id=mid
|
||||
)
|
||||
|
Reference in New Issue
Block a user