no-perms-fix
This commit is contained in:
parent
c3f69d9198
commit
84c8ba11df
|
@ -77,9 +77,15 @@ async def messages_routing(msg, state):
|
||||||
reply_to_message_id=reply_to_msg_id,
|
reply_to_message_id=reply_to_msg_id,
|
||||||
text=text,
|
text=text,
|
||||||
)
|
)
|
||||||
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
try:
|
||||||
|
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
elif text == "/removed@welcomecenter_bot":
|
elif text == "/removed@welcomecenter_bot":
|
||||||
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
try:
|
||||||
|
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
toxic_score = detector(normalize(text))
|
toxic_score = detector(normalize(text))
|
||||||
toxic_perc = math.floor(toxic_score * 100)
|
toxic_perc = math.floor(toxic_score * 100)
|
||||||
|
@ -89,7 +95,10 @@ async def messages_routing(msg, state):
|
||||||
if toxic_score > 0.81:
|
if toxic_score > 0.81:
|
||||||
if toxic_score > 0.90:
|
if toxic_score > 0.90:
|
||||||
await redis.set(f"removed:{uid}:{cid}:{mid}", text)
|
await redis.set(f"removed:{uid}:{cid}:{mid}", text)
|
||||||
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
try:
|
||||||
|
await telegram_api("deleteMessage", chat_id=cid, message_id=mid)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
await telegram_api(
|
await telegram_api(
|
||||||
"setMessageReaction",
|
"setMessageReaction",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user