class VoiceState
extends
Baseexport class VoiceState extends BaseRepresents the voice state for a Guild Member.
readonlychannel : VoiceBasedChannel | null
The channel that the member is connected to
The VoiceChannel or StageChannel id the member is in
guild : Guild
The guild of this voice state
id : Snowflake
The id of the member of this voice state
readonlymember : GuildMember | null
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.
disconnect(reason?: string) : Promise<GuildMember>
Disconnects the member from the channel.
edit(options: VoiceStateEditOptions) : Promise<this>
Edits this voice state. Currently only available when in a stage channel
fetch(force?: boolean) : Promise<VoiceState>
Fetches this voice state.
setChannel(channel: 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);