Add notification settings

This commit is contained in:
2026-01-04 02:47:38 +07:00
parent 7a3576aec0
commit 475e2cf4cd
14 changed files with 517 additions and 26 deletions

View File

@@ -124,6 +124,22 @@ class APIClient:
"""Get user's overall statistics."""
return await self._request("GET", f"/telegram/stats/{telegram_id}")
async def get_notification_settings(self, telegram_id: int) -> dict[str, Any] | None:
"""Get user's notification settings."""
return await self._request("GET", f"/telegram/notifications/{telegram_id}")
async def update_notification_settings(
self,
telegram_id: int,
settings: dict[str, bool]
) -> dict[str, Any] | None:
"""Update user's notification settings."""
return await self._request(
"PATCH",
f"/telegram/notifications/{telegram_id}",
json=settings
)
async def close(self):
"""Close the HTTP session."""
if self._session and not self._session.closed: