fix-joinleft

This commit is contained in:
Untone 2023-09-18 16:23:32 +03:00
parent bf31e8aa51
commit 0beca5bf04

View File

@ -6,15 +6,15 @@ import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
async def handle_join_request(msg):
logger.info(f"handle join request {msg}")
chat_id = str(msg["chat"]["id"])
from_id = str(msg["from"]["id"])
actor = Profile.get(from_id, msg)
async def handle_join_request(join_request):
logger.info(f"handle join request {join_request}")
chat_id = str(join_request["chat"]["id"])
from_id = str(join_request["from"]["id"])
actor = Profile.get(from_id, join_request)
if len(actor["parents"]) == 0:
# показываем сообщение с кнопкой "поручиться"
await show_request_msg(msg)
await show_request_msg(join_request)
else:
# за пользователя поручились ранее
r = await approve_chat_join_request(chat_id, from_id)