Skip to content

StageInstanceManager

StageInstanceManager ⇐ Base

Manages stage instances in a guild.

Kind: global class
Extends: Base

new StageInstanceManager(client)

Constructs a new instance of the class.

ParamTypeDescription
clientClientThe 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

ParamTypeDefaultDescription
stageInstancesstring | StageInstanceThe 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]booleantrueWhether to cache the stage instance or not.
[options.force]booleanfalseWhether 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.

ParamTypeDefaultDescription
channelstring | ChannelThe channel or channel ID to fetch the stage instance from.
[options]ObjectAdditional options for the fetch.
[options.cache]booleantrueWhether to cache the fetched stage instance.
[options.force]booleanfalseWhether 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.

ParamTypeDescription
[options]ObjectThe options for creating the stage instance.
[options.reason]stringThe 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.

ParamTypeDescription
channelstring | ChannelThe channel or channel ID where the stage instance is located.
[options]ObjectAdditional options for editing the stage instance.
[options.reason]stringThe 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.

ParamTypeDescription
channelstring | ChannelThe channel or channel ID where the stage instance is located.
reasonstringThe 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.

ParamTypeDescription
[payload]objectThe payload object to transform.