class StageChannel
extends
BaseGuildVoiceChannelexport class StageChannel extends BaseGuildVoiceChannel
Represents a guild stage channel on Discord.
readonlyboolean full :
Checks if the voice-based channel is full
Inherited from: BaseGuildVoiceChannel
readonlyboolean joinable :
Whether the channel is joinable by the client user
Inherited from: BaseGuildVoiceChannel
readonlyoptionalMessage lastMessage? :
The Message object of the last message in the channel, if one was sent
Inherited from: BaseGuildVoiceChannel
optionalSnowflake lastMessageId? :
The last message id sent in the channel, if one was sent
Inherited from: BaseGuildVoiceChannel
readonlyCollection<Snowflake, GuildMember> members :
The members in this voice-based channel
Inherited from: BaseGuildVoiceChannel
GuildMessageManager messages :
A manager of the messages sent to this channel
Inherited from: BaseGuildVoiceChannel
The rate limit per user (slowmode) for this channel in seconds
Inherited from: BaseGuildVoiceChannel
The RTC region for this voice-based channel. This region is automatically selected if null
.
Inherited from: BaseGuildVoiceChannel
readonlyStageInstance | null stageInstance :
The stage instance of this stage channel, if it exists
ChannelType.GuildStageVoice type :
The type of the channel
number userLimit :
The maximum amount of users allowed in this channel.
Inherited from: BaseGuildVoiceChannel
VideoQualityMode | null videoQualityMode :
The camera video quality mode of the channel.
Inherited from: BaseGuildVoiceChannel
awaitMessageComponentoptions?: AwaitMessageComponentOptions) : Promise<MessageComponentInteraction> (
Collects a single component interaction that passes the filter. The Promise will reject if the time expires.
// Collect a message component interaction
const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId';
channel.awaitMessageComponent({ filter, time: 15_000 })
.then(interaction => console.log(`${interaction.customId} was clicked!`))
.catch(console.error);
Inherited from: BaseGuildVoiceChannel
awaitMessagesoptions?: AwaitMessagesOptions) : Promise<Collection<Snowflake, Message>> (
Similar to createMessageCollector but in promise form. Resolves with a collection of messages that pass the specified filter.
// Await !vote messages
const filter = m => m.content.startsWith('!vote');
// Errors: ['time'] treats ending because of the time limit as an error
channel.awaitMessages({ filter, max: 4, time: 60_000, errors: ['time'] })
.then(collected => console.log(collected.size))
.catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
Inherited from: BaseGuildVoiceChannel
bulkDeletemessages: Collection<Snowflake, Message> | Array<MessageResolvable> | numberfilterOld?: boolean) : Promise<Collection<Snowflake, (Message|undefined)>> (
Bulk deletes given messages that are newer than two weeks.
// Bulk delete messages
channel.bulkDelete(5)
.then(messages => console.log(`Bulk deleted ${messages.size} messages`))
.catch(console.error);
Returns: Returns the deleted messages *
Inherited from: BaseGuildVoiceChannel
createInviteoptions?: InviteCreateOptions) : Promise<Invite> (
Creates an invite to this guild channel.
// Create an invite to a channel
channel.createInvite()
.then(invite => console.log(`Created an invite with a code of ${invite.code}`))
.catch(console.error);
Inherited from: BaseGuildVoiceChannel
createMessageCollectoroptions?: MessageCollectorOptions) : MessageCollector (
Creates a Message Collector.
// Create a message collector
const filter = message => message.content.includes('discord');
const collector = channel.createMessageCollector({ filter, time: 15_000 });
collector.on('collect', message => console.log(`Collected ${message.content}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
Inherited from: BaseGuildVoiceChannel
createMessageComponentCollectoroptions?: MessageComponentCollectorOptions) : InteractionCollector (
Creates a component interaction collector.
// Create a button interaction collector
const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId';
const collector = channel.createMessageComponentCollector({ filter, time: 15_000 });
collector.on('collect', interaction => console.log(`Collected ${interaction.customId}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
Inherited from: BaseGuildVoiceChannel
createStageInstanceoptions: StageInstanceCreateOptions) : Promise<StageInstance> (
Creates a stage instance associated with this stage channel.
createWebhookoptions?: ChannelWebhookCreateOptions) : Promise<Webhook> (
Creates a webhook for the channel.
// Create a webhook for the current channel
channel.createWebhook({
name: 'Snek',
avatar: 'https://i.imgur.com/mI8XcpG.jpg',
reason: 'Needed a cool new Webhook'
})
.then(console.log)
.catch(console.error)
Returns: Returns the created Webhook *
Inherited from: BaseGuildVoiceChannel
fetchInvitescache?: boolean) : Promise<Collection<string, Invite>> (
Fetches a collection of invites to this guild channel.
Inherited from: BaseGuildVoiceChannel
fetchWebhooksPromise<Collection<Snowflake, Webhook>> () :
Fetches all webhooks for the channel.
// Fetch webhooks
channel.fetchWebhooks()
.then(hooks => console.log(`This channel has ${hooks.size} hooks`))
.catch(console.error);
Inherited from: BaseGuildVoiceChannel
sendoptions: string | MessagePayload | MessageCreateOptions) : Promise<Message> (
Sends a message to this channel.
// Send a basic message
channel.send('hello!')
.then(message => console.log(`Sent message: ${message.content}`))
.catch(console.error);
// Send a remote file
channel.send({
files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']
})
.then(console.log)
.catch(console.error);
// Send a local file
channel.send({
files: [{
attachment: 'entire/path/to/file.jpg',
name: 'file.jpg',
description: 'A description of the file'
}]
})
.then(console.log)
.catch(console.error);
Inherited from: BaseGuildVoiceChannel
Sends a typing indicator in the channel.
// Start typing in a channel
channel.sendTyping();
Returns: Resolves upon the typing status being sent *
Inherited from: BaseGuildVoiceChannel
setBitrate) : Promise<StageChannel> (
Sets the bitrate of the channel.
// Set the bitrate of a voice channel
stageChannel.setBitrate(48_000)
.then(channel => console.log(`Set bitrate to ${channel.bitrate}bps for ${channel.name}`))
.catch(console.error);
Sets whether this channel is flagged as NSFW.
Inherited from: BaseGuildVoiceChannel
Sets the rate limit per user (slowmode) for this channel.
Inherited from: BaseGuildVoiceChannel
setRTCRegion) : Promise<StageChannel> (
Sets the RTC region of the channel.
// Set the RTC region to sydney
stageChannel.setRTCRegion('sydney');
// Remove a fixed region for this channel - let Discord decide automatically
stageChannel.setRTCRegion(null, 'We want to let Discord decide.');
setTopictopic: string) : Promise<StageChannel> (
Sets a new topic for the guild channel.
// Set a new channel topic
stageChannel.setTopic('needs more rate limiting')
.then(channel => console.log(`Channel's new topic is ${channel.topic}`))
.catch(console.error);
setUserLimit) : Promise<StageChannel> (
Sets the user limit of the channel.
// Set the user limit of a voice channel
stageChannel.setUserLimit(42)
.then(channel => console.log(`Set user limit to ${channel.userLimit} for ${channel.name}`))
.catch(console.error);
setVideoQualityModevideoQualityMode: VideoQualityModereason?: string) : Promise<StageChannel> (
Sets the camera video quality mode of the channel.