diff --git a/handlers/messages_routing.py b/handlers/messages_routing.py index 7e6c196..59c2b23 100644 --- a/handlers/messages_routing.py +++ b/handlers/messages_routing.py @@ -48,8 +48,8 @@ async def messages_routing(msg, state): latest_toxic_message_id = await redis.get(f"toxic:{cid}") scoring_msg_id = reply_msg.get("message_id") or latest_toxic_message_id toxic_score = await redis.get(f"toxic:{cid}:{uid}:{scoring_msg_id}") - if toxic_score: - text = f"{int(toxic_score)}% токсичности" + x = int(toxic_score) if toxic_score else 0 + text = f"{x}% токсичности" await telegram_api( "deleteMessage", chat_id=cid,