dokku-comp

This commit is contained in:
2023-09-11 23:04:53 +03:00
parent 4be2dc3a45
commit b9a98f1e56
25 changed files with 646 additions and 460 deletions

View File

@@ -1,20 +1,19 @@
from bot.api import approve_chat_join_request, delete_message
from bot.api import approve_chat_join_request, delete_message
from bot.handlers.send_button import show_request_msg
from bot.storage import Profile, storage
def handle_join_request(msg):
print(f'handle join request {msg}')
chat_id = str(msg['chat']['id'])
from_id = str(msg['from']['id'])
async def handle_join_request(msg):
print(f"handle join request {msg}")
chat_id = str(msg["chat"]["id"])
from_id = str(msg["from"]["id"])
actor = Profile.get(from_id, msg)
if len(actor['parents']) == 0:
if len(actor["parents"]) == 0:
# показываем сообщение с кнопкой "поручиться"
show_request_msg(msg)
await show_request_msg(msg)
else:
# за пользователя поручились ранее
r = approve_chat_join_request(chat_id, from_id)
r = await approve_chat_join_request(chat_id, from_id)
print(r)
Profile.save(actor)