Constructor
# new Notification(data)
Creates new notification
Parameters:
| Name | Type | Description |
|---|---|---|
data |
any
|
Classes
Methods
# async static fetchData(data, ctx) → {Promise.<object>}
Fetches data
Parameters:
| Name | Type | Description |
|---|---|---|
data |
any
|
|
ctx |
RequestContext
|
Promise.<object>
# async static fromDatabase(data, ctx)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
DBNotification
|
DBNotificationAny
|
|
ctx |
RequestContext
|
# async static getPublicNotifications(ctx) → {Promise.<Collection.<SnowflakeString, Notification>>}
Returns public notifications for the home page
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
RequestContext
|
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
|
Promise.<Collection.<SnowflakeString, Notification>>