Constructor
# new BasicAnimation(data)
Creates new animation data object
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object
|
Classes
Methods
# static countAnimations(ctx, ifilters) → {Promise.<number>}
Counts animations matching given filters
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
RequestContext
|
|
ifilters |
IFilters
|
Promise.<number>
# async static fromDatabase(data, ctx) → {Promise.<BasicAnimation>}
Parameters:
| Name | Type | Description |
|---|---|---|
data |
DBAnimation
|
DBAnimationFull
|
|
ctx |
RequestContext
|
Promise.<BasicAnimation>
# async static getAnimation(id, ctx) → {Promise.<BasicAnimation>}
Fetches animation by snowflake from DB
Parameters:
| Name | Type | Description |
|---|---|---|
id |
AnimationResolvable
|
|
ctx |
RequestContext
|
Promise.<BasicAnimation>
# static getAnimations(ctx, ifilters) → {Promise.<Collection.<SnowflakeString, BasicAnimation>>}
Gets animations that fit into the specified filters
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
RequestContext
|
|
ifilters |
IFilters
|
Promise.<Collection.<SnowflakeString, BasicAnimation>>
# async static getFullAnimation(id, ctx) → {Promise.<Animation>}
Expands animation to full animation
Parameters:
| Name | Type | Description |
|---|---|---|
id |
AnimationResolvable
|
|
ctx |
RequestContextWithClient
|
Promise.<Animation>
# static isAnimation(animation) → {boolean}
Returns if the param is animation or not. Used for TS.
Parameters:
| Name | Type | Description |
|---|---|---|
animation |
AnimationResolvable
|
boolean
# async static newAnimation(data) → {Promise.<Animation>}
Fetches all animations from DB
Parameters:
| Name | Type | Description |
|---|---|---|
data |
any
|
Promise.<Animation>
# static resolveAnimationID(animation) → {SnowflakeString}
Resolves params to string
Parameters:
| Name | Type | Description |
|---|---|---|
animation |
UserResolvable
|
SnowflakeString
# async getAverageRating() → {Promise.<(number|null)>}
Promise.<(number|null)>
# async getComments(max, page) → {Promise.<Collection.<SnowflakeString, Comment>>}
Fetches comments on the animation
Parameters:
| Name | Type | Description |
|---|---|---|
max |
number
|
items per page |
page |
number
|
Promise.<Collection.<SnowflakeString, Comment>>
# getRatingFrom(user) → {Promise.<(Rating|null)>}
Returns a rating from given user, if any
Parameters:
| Name | Type | Description |
|---|---|---|
user |
UserResolvable
|
Promise.<(Rating|null)>
# async getRatings(max, page) → {Promise.<Collection.<SnowflakeString, Rating>>}
Fetches ratings on the animation
Parameters:
| Name | Type | Description |
|---|---|---|
max |
number
|
items per page |
page |
number
|
Promise.<Collection.<SnowflakeString, Rating>>
# toMinimal(includeAuthor) → {object}
Returns minimum animation representation
Parameters:
| Name | Type | Description |
|---|---|---|
includeAuthor |
boolean
|
object