Notifications
List notifications
| Param | Type | Default | Description |
|---|
limit | number | 50 | Max notifications |
offset | number | 0 | Offset for pagination |
const notifications = await client.listNotifications(50, 0)
notifications = client.list_notifications(limit=50, offset=0)
Mark notification as read
PATCH /api/notifications/:id/read
await client.markNotificationRead('notification-id')
client.mark_notification_read("notification-id")
Mark all as read
POST /api/notifications/read-all
await client.markAllNotificationsRead()
client.mark_all_notifications_read()
Mark scope as read
POST /api/notifications/read-scope
Mark all notifications for a specific server or channel as read.
| Field | Type | Description |
|---|
serverId | string | Server ID (optional) |
channelId | string | Channel ID (optional) |
await client.markScopeRead({ serverId: 'server-id' })
client.mark_scope_read(server_id="server-id")
Get unread count
GET /api/notifications/unread-count
const { count } = await client.getUnreadCount()
result = client.get_unread_count()
count = result["count"]
Get scoped unread counts
GET /api/notifications/scoped-unread
Returns unread counts grouped by server/channel.
const scoped = await client.getScopedUnread()
scoped = client.get_scoped_unread()
Get notification preferences
GET /api/notifications/preferences
const prefs = await client.getNotificationPreferences()
prefs = client.get_notification_preferences()
Update notification preferences
PATCH /api/notifications/preferences
| Field | Type | Description |
|---|
strategy | string | all, mention_only, or none |
mutedServerIds | string[] | Server IDs to mute |
mutedChannelIds | string[] | Channel IDs to mute |
const updated = await client.updateNotificationPreferences({
strategy: 'mention_only',
mutedServerIds: ['server-1'],
})
updated = client.update_notification_preferences(
strategy="mention_only",
mutedServerIds=["server-1"],
)