mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-23 21:01:17 +00:00
- Add pyproject.toml with uv and ruff configuration - Pin Python version to 3.13 via .python-version - Add Makefile commands: lint, format, fix - Apply ruff formatting to entire codebase - Remove unused imports (base64 in yookassa/simple_subscription) - Update .gitignore for new config files
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]
|