fix-reply-feedback

This commit is contained in:
Untone 2023-09-18 11:01:13 +03:00
parent 95071ec301
commit cb00c50ef3
3 changed files with 13 additions and 4 deletions

View File

@ -3,6 +3,9 @@ from api import send_document
from storage import storage, scan
import json
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
async def handle_command_graph(msg):
_usr_ids, members = scan(match="usr-*", count=100)

View File

@ -41,6 +41,8 @@ async def handle_feedback(msg, state):
async def handle_answer(msg):
answered_msg = msg["reply_to_message"]
if "from" not in answered_msg:
answered_msg["from"] = vars(msg.from_user)
r = await get_chat_administrators(msg["chat"]["id"])
logger.debug(r)
admins = []

View File

@ -16,10 +16,14 @@ async def handle_routing(msg, state):
if cid == uid:
# сообщения в личке с ботом
logger.info("private chat message")
if msg["text"].startswith("/my"):
await handle_command_my(msg, state)
else:
await handle_feedback(msg, state)
if "text" in msg:
text = msg["text"]
if text.startswith("/my"):
await handle_command_my(msg, state)
elif text.startswith("/graph"):
await handle_command_graph(msg)
else:
await handle_feedback(msg, state)
elif str(cid) == FEEDBACK_CHAT_ID:
# сообщения из группы обратной связи