class VoiceState
extends
Baseexport class VoiceState extends Base
Represents the voice state for a Guild Member.
readonlyVoiceBasedChannel | null channel :
The channel that the member is connected to
The VoiceChannel or StageChannel id the member is in
readonlyClient client :
The client that instantiated this
Guild guild :
The guild of this voice state
Snowflake id :
The id of the member of this voice state
readonlyGuildMember | null member :
The member that this voice state belongs to
The time at which the member requested to speak. This property is specific to stage channels only.
disconnectreason?: string) : Promise<GuildMember> (
Disconnects the member from the channel.
editoptions: VoiceStateEditOptions) : Promise<this> (
Edits this voice state. Currently only available when in a stage channel
setChannelchannel: GuildVoiceChannelResolvable | nullreason?: string) : Promise<GuildMember> (
Moves the member to a different channel, or disconnects them from the one they're in.
setDeaf) : Promise<GuildMember> (
Deafens/undeafens the member of this voice state.
setMute) : Promise<GuildMember> (
Mutes/unmutes the member of this voice state.
Toggles the request to speak in the channel. Only applicable for stage channels and for the client's own voice state.
// Making the client request to speak in a stage channel (raise its hand)
guild.members.me.voice.setRequestToSpeak(true);
// Making the client cancel a request to speak
guild.members.me.voice.setRequestToSpeak(false);
Suppress/unsuppress the user. Only applicable for stage channels.
// Making the client a speaker
guild.members.me.voice.setSuppressed(false);
// Making the client an audience member
guild.members.me.voice.setSuppressed(true);
// Inviting another user to speak
voiceState.setSuppressed(false);
// Moving another user to the audience, or cancelling their invite to speak
voiceState.setSuppressed(true);