mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-01-20 03:40:26 +00:00
- Добавлено восстановление описания чека из настроек при обработке очереди - Передача telegram_user_id и amount_kopeks через всю цепочку создания чеков - Переход на локальную исправленную версию библ
41 lines
937 B
Python
41 lines
937 B
Python
"""
|
|
User API implementation.
|
|
Based on PHP library's Api\\User class.
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
from ._http import AsyncHTTPClient
|
|
|
|
|
|
class UserAPI:
|
|
"""
|
|
User API for user information.
|
|
|
|
Provides async methods for:
|
|
- Getting current user information
|
|
|
|
Maps to PHP Api\\User functionality.
|
|
"""
|
|
|
|
def __init__(self, http_client: AsyncHTTPClient):
|
|
self.http = http_client
|
|
|
|
async def get(self) -> dict[str, Any]:
|
|
"""
|
|
Get current user information.
|
|
|
|
Maps to PHP User::get().
|
|
|
|
Returns:
|
|
Dictionary with user profile data including:
|
|
- id, inn, displayName, email, phone
|
|
- registration dates, status, restrictions
|
|
- avatar, receipt settings, etc.
|
|
|
|
Raises:
|
|
DomainException: For API errors
|
|
"""
|
|
response = await self.http.get("/user")
|
|
return response.json() # type: ignore[no-any-return]
|