mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feat(StageChannel): add createStageInstance method & use better naming convention (#5951)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -20,14 +20,23 @@ class StageChannel extends BaseGuildVoiceChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* The instance of this stage channel, if it exists
|
||||
* The stage instance of this stage channel, if it exists
|
||||
* @type {?StageInstance}
|
||||
* @readonly
|
||||
*/
|
||||
get instance() {
|
||||
get stageInstance() {
|
||||
return this.guild.stageInstances.cache.find(stageInstance => stageInstance.channelID === this.id) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a stage instance associated to this stage channel.
|
||||
* @param {StageInstanceCreateOptions} options The options to create the stage instance
|
||||
* @returns {Promise<StageInstance>}
|
||||
*/
|
||||
createStageInstance(options) {
|
||||
return this.guild.stageInstances.create(this.id, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RTC region of the channel.
|
||||
* @name StageChannel#setRTCRegion
|
||||
|
||||
@@ -60,7 +60,7 @@ class StageInstance extends Base {
|
||||
}
|
||||
|
||||
/**
|
||||
* The stage channel associated with this instance
|
||||
* The stage channel associated with this stage instance
|
||||
* @type {?StageChannel}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user