fix-left-join

This commit is contained in:
2023-09-18 14:02:24 +03:00
parent 0abf216d87
commit 19d0984466
7 changed files with 40 additions and 47 deletions

View File

@@ -1,5 +1,4 @@
from handlers.handle_feedback import handle_feedback, handle_answer
from handlers.handle_members_change import handle_join, handle_left
from handlers.handle_default import handle_default
from handlers.command_my import handle_command_my
from handlers.command_graph import handle_command_graph
@@ -16,8 +15,8 @@ async def handle_routing(msg, state):
if cid == uid:
# сообщения в личке с ботом
logger.info("private chat message")
if "text" in msg:
text = msg["text"]
text = msg.get("text")
if text:
if text.startswith("/my"):
await handle_command_my(msg, state)
elif text.startswith("/graph"):
@@ -37,9 +36,6 @@ async def handle_routing(msg, state):
else:
# сообщения из всех остальных групп
logger.info(f"group {cid} chat message")
if "text" in msg:
await handle_default(msg)
elif "new_chat_member" in msg:
await handle_join(msg)
elif "left_chat_member" in msg:
await handle_left(msg)
text = msg.get("text", msg.get("caption"))
if text:
await handle_default(msg, state)