DEBUG
BOT_open_sesam/pipeline/head This commit looks good Details

Пытаемся поймать передаваемый номер в логах
test
dl 2025-05-30 10:17:50 +05:00
parent 93e5303ee6
commit 73c2f1f440
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ def normalize_phone(phone: str) -> str:
async def authorize_user(user_id: int, phone: str) -> bool:
normalized = normalize_phone(phone)
api_url = "https://papi.dataekb.ru/check_access"
print("DEBUG: phone (var normalized) is ", normalized)
async with aiohttp.ClientSession() as session:
try:
async with session.get(api_url, params={"tel": normalized}) as response:

View File

@ -15,6 +15,7 @@ def register_contact_handler(dp: Dispatcher):
phone = msg.contact.phone_number
if not await authorize_user(user_id, phone):
print("DEBUG: phone in contact_handler is ", phone)
await msg.answer("Доступ запрещён, номер не идентифицирован")
return