StageInstanceManager
StageInstanceManager ⇐ Base
Manages stage instances in a guild.
Kind: global class
Extends: Base
- StageInstanceManager ⇐
Base
- new StageInstanceManager(client)
- instance
- .cache ⇒
- ._add(stageInstances, [guildId], [options]) ⇒
StageInstance
|null
- .fetch(channel, [options]) ⇒
Promise.<StageInstance>
- .create([options]) ⇒
Promise.<StageInstance>
- .edit(channel, [options]) ⇒
Promise.<StageInstance>
- .delete(channel, reason) ⇒
Promise.<(StageInstance|null)>
- static
- .transformPayload([payload]) ⇒
object
- .transformPayload([payload]) ⇒
new StageInstanceManager(client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
client | Client | The client object used for communication with the server. |
stageInstanceManager.cache ⇒
Getter method for the cache property.
Kind: instance property of StageInstanceManager
Returns: The Collection object representing the cache.
stageInstanceManager._add(stageInstances, [guildId], [options]) ⇒ StageInstance
| null
Adds a stage instance to the cache and returns the stage instance object.
Kind: instance method of StageInstanceManager
Returns: StageInstance
| null
- The stage
Param | Type | Default | Description |
---|---|---|---|
stageInstances | string | StageInstance | The stage instance ID or the stage instance object. | |
[guildId] | string | ”this.guildId” | The ID of the guild where the stage instance belongs to. |
[options] | object | {cache: true, force: false} | Additional options for adding the stage instance. |
[options.cache] | boolean | true | Whether to cache the stage instance or not. |
[options.force] | boolean | false | Whether to force fetch the stage instance even if it is already in the cache. |
stageInstanceManager.fetch(channel, [options]) ⇒ Promise.<StageInstance>
Fetches a stage instance from the API.
Kind: instance method of StageInstanceManager
Returns: Promise.<StageInstance>
- A promise that resolves with the fetched stage instance.
Param | Type | Default | Description |
---|---|---|---|
channel | string | Channel | The channel or channel ID to fetch the stage instance from. | |
[options] | Object | Additional options for the fetch. | |
[options.cache] | boolean | true | Whether to cache the fetched stage instance. |
[options.force] | boolean | false | Whether to force fetch the stage instance even if it is already cached. |
stageInstanceManager.create([options]) ⇒ Promise.<StageInstance>
Creates a new stage instance with the given options.
Kind: instance method of StageInstanceManager
Returns: Promise.<StageInstance>
- A promise that resolves with the created stage instance.
Param | Type | Description |
---|---|---|
[options] | Object | The options for creating the stage instance. |
[options.reason] | string | The reason for creating the stage instance. |
stageInstanceManager.edit(channel, [options]) ⇒ Promise.<StageInstance>
Edits a stage instance in a channel.
Kind: instance method of StageInstanceManager
Returns: Promise.<StageInstance>
- A promise that resolves with the updated stage instance.
Param | Type | Description |
---|---|---|
channel | string | Channel | The channel or channel ID where the stage instance is located. |
[options] | Object | Additional options for editing the stage instance. |
[options.reason] | string | The reason for editing the stage instance. |
stageInstanceManager.delete(channel, reason) ⇒ Promise.<(StageInstance|null)>
Deletes a stage instance from a channel.
Kind: instance method of StageInstanceManager
Returns: Promise.<(StageInstance|null)>
- - A promise that resolves to the deleted stage instance, or null if it does not exist.
Param | Type | Description |
---|---|---|
channel | string | Channel | The channel or channel ID where the stage instance is located. |
reason | string | The reason for deleting the stage instance. |
StageInstanceManager.transformPayload([payload]) ⇒ object
Transforms the given payload object into a new object with specific properties.
Kind: static method of StageInstanceManager
Returns: object
- - The transformed payload object.
Param | Type | Description |
---|---|---|
[payload] | object | The payload object to transform. |