From d6505014a2543e9888cd5cb1fb009952ee0308f3 Mon Sep 17 00:00:00 2001 From: firedotguy Date: Thu, 29 Jan 2026 20:37:05 +0300 Subject: [PATCH] feat: add notifications --- itd/notifications.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 itd/notifications.py diff --git a/itd/notifications.py b/itd/notifications.py new file mode 100644 index 0000000..8ad6759 --- /dev/null +++ b/itd/notifications.py @@ -0,0 +1,16 @@ +from itd.request import fetch + +def get_notifications(token: str, limit: int = 20, cursor: int = 0, type: str | None = None): + data = {'limit': str(limit), 'cursor': str(cursor)} + if type: + data['type'] = type + return fetch(token, 'get', 'notifications', data) + +def mark_as_read(token: str, id: str): + return fetch(token, 'post', f'notification/{id}/read') + +def mark_all_as_read(token: str): + return fetch(token, 'post', f'notification/read-all') + +def get_unread_notifications_count(token: str): + return fetch(token, 'get', 'notifications/count') \ No newline at end of file