Add notification settings
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user