fixes-logs-imports

This commit is contained in:
2023-09-18 10:50:48 +03:00
parent cf4f13ae9b
commit 95071ec301
14 changed files with 98 additions and 61 deletions

View File

@@ -2,9 +2,12 @@ from api import approve_chat_join_request, delete_message
from handlers.send_button import show_request_msg
from storage import Profile, storage
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
async def handle_join_request(msg):
print(f"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)
@@ -15,5 +18,5 @@ async def handle_join_request(msg):
else:
# за пользователя поручились ранее
r = await approve_chat_join_request(chat_id, from_id)
print(r)
logger.debug(r)
Profile.save(actor)