Skip to content

StageInstanceManager

classe · Source

Manages API methods for StageInstance objects and holds their cache.

Extends: CachedManager

Properties

guild

guild: Guild

The guild this manager belongs to Source

cache

cache: Collection<Snowflake, StageInstance>

The cache of this Manager Source

_cache

readonly · private

_cache: Collection

The private cache of items for this manager. Source

holds

readonly · private

holds: function

The data structure belonging to this manager. Source

client

readonly

client: Client

The client that instantiated this Manager Source

Methods

create

async

async create(channel: StageChannelResolvable, options: StageInstanceCreateOptions): Promise<StageInstance>

Creates a new stage instance. Parameters

NameTypeDescription
channelStageChannelResolvableThe stage channel to associate the created stage instance to
optionsStageInstanceCreateOptionsThe options to create the stage instance

Returns: Promise<StageInstance>

js
// Create a stage instance
guild.stageInstances.create('1234567890123456789', {
 topic: 'A very creative topic',
 privacyLevel: 'GUILD_ONLY'
})
 .then(stageInstance => console.log(stageInstance))
 .catch(console.error);

Source

fetch

async

async fetch(channel: StageChannelResolvable, options?: BaseFetchOptions): Promise<StageInstance>

Fetches the stage instance associated with a stage channel, if it exists. Parameters

NameTypeDescription
channelStageChannelResolvableThe stage channel whose associated stage instance is to be fetched
options?BaseFetchOptionsAdditional options for this fetch

Returns: Promise<StageInstance>

js
// Fetch a stage instance
guild.stageInstances.fetch('1234567890123456789')
 .then(stageInstance => console.log(stageInstance))
 .catch(console.error);

Source

edit

async

async edit(channel: StageChannelResolvable, options: StageInstanceEditOptions): Promise<StageInstance>

Edits an existing stage instance. Parameters

NameTypeDescription
channelStageChannelResolvableThe stage channel whose associated stage instance is to be edited
optionsStageInstanceEditOptionsThe options to edit the stage instance

Returns: Promise<StageInstance>

js
// Edit a stage instance
guild.stageInstances.edit('1234567890123456789', { topic: 'new topic' })
 .then(stageInstance => console.log(stageInstance))
 .catch(console.error);

Source

delete

async

async delete(channel: StageChannelResolvable): Promise<void>

Deletes an existing stage instance. Parameters

NameTypeDescription
channelStageChannelResolvableThe stage channel whose associated stage instance is to be deleted

Returns: Promise<void>Source

resolve

resolve(idOrInstance: string | Object): Object

Resolves a data entry to a data Object. Parameters

NameTypeDescription
idOrInstancestring | ObjectThe id or instance of something in this Manager

Returns: Object — An instance from this Manager Source

resolveId

resolveId(idOrInstance: string | Object): Snowflake

Resolves a data entry to an instance id. Parameters

NameTypeDescription
idOrInstancestring | ObjectThe id or instance of something in this Manager

Returns: SnowflakeSource

Unofficial software. Not affiliated with or supported by Discord.