Class

Notification

Notification(data)

Handles notification data

Constructor

# new Notification(data)

Creates new notification

Parameters:
Name Type Description
data any

View Source classes/notification.ts, line 14

Classes

Notification

Methods

# async static fetchData(data, ctx) → {Promise.<object>}

Fetches data

Parameters:
Name Type Description
data any
ctx RequestContext

View Source classes/notification.ts, line 249

Promise.<object>

# async static fromDatabase(data, ctx)

Parameters:
Name Type Description
data DBNotification | DBNotificationAny
ctx RequestContext

View Source classes/notification.ts, line 233

# async static getPublicNotifications(ctx) → {Promise.<Collection.<SnowflakeString, Notification>>}

Returns public notifications for the home page

Parameters:
Name Type Description
ctx RequestContext

View Source classes/notification.ts, line 257

Promise.<Collection.<SnowflakeString, Notification>>

# async static getUserNotifications(ctx, page, max) → {Promise.<Collection.<SnowflakeString, Notification>>}

Returns user specific notifications. If no user in context, returns public notifications

Parameters:
Name Type Description
ctx RequestContext
page number
max number

View Source classes/notification.ts, line 267

Promise.<Collection.<SnowflakeString, Notification>>

# async create() → {Promise.<void>}

Saves the notification into database

View Source classes/notification.ts, line 240

Promise.<void>

# toJSON() → {any}

Returns JSON compatible representation

View Source classes/notification.ts, line 273

any