VoiceState

export class VoiceState extends Base
export class VoiceState extends Base
Represents the voice state for a Guild Member.

Extends

Base
Readonly
The channel that the member is connected to
channelId:Snowflake | null
The VoiceChannel or StageChannel id the member is in
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
Readonly
deaf:boolean | null
Whether this member is either self-deafened or server-deafened
guild:Guild
The guild of this voice state
The id of the member of this voice state
Readonly
member:GuildMember | null
The member that this voice state belongs to
Readonly
mute:boolean | null
Whether this member is either self-muted or server-muted
requestToSpeakTimestamp:number | null
The time at which the member requested to speak. This property is specific to stage channels only.
selfDeaf:boolean | null
Whether this member is self-deafened
selfMute:boolean | null
Whether this member is self-muted
selfVideo:boolean | null
Whether this member's camera is enabled
serverDeaf:boolean | null
Whether this member is deafened server-wide
serverMute:boolean | null
Whether this member is muted server-wide
sessionId:string | null
The session id for this member's connection
streaming:boolean | null
Whether this member is streaming using "Screen Share"
suppress:boolean | null
Whether this member is suppressed from speaking. This property is specific to stage channels only.
disconnect(reason?):Promise<GuildMember>
Disconnects the member from the channel.
NameTypeOptionalDescription
reasonstringYesReason for disconnecting the member from the channel
edit(options):Promise<this>
Edits this voice state. Currently only available when in a stage channel
NameTypeOptionalDescription
optionsVoiceStateEditOptionsNoThe options to provide
fetch(force?):Promise<VoiceState>
Fetches this voice state.
NameTypeOptionalDescription
forcebooleanYesWhether to skip the cache check and request the API
setChannel(channel, reason?):Promise<GuildMember>
Moves the member to a different channel, or disconnects them from the one they're in.
NameTypeOptionalDescription
channelGuildVoiceChannelResolvable | nullNoChannel to move the member to, or null if you want to disconnect them from voice.
reasonstringYesReason for moving member to another channel or disconnecting
setDeaf(deaf?, reason?):Promise<GuildMember>
Deafens/undeafens the member of this voice state.
NameTypeOptionalDescription
deafbooleanYesWhether or not the member should be deafened
reasonstringYesReason for deafening or undeafening
setMute(mute?, reason?):Promise<GuildMember>
Mutes/unmutes the member of this voice state.
NameTypeOptionalDescription
mutebooleanYesWhether or not the member should be muted
reasonstringYesReason for muting or unmuting
setRequestToSpeak(requestToSpeak?):Promise<this>
Toggles the request to speak in the channel. Only applicable for stage channels and for the client's own voice state.
Example
// Making the client request to speak in a stage channel (raise its hand)
guild.members.me.voice.setRequestToSpeak(true);
// Making the client request to speak in a stage channel (raise its hand)
guild.members.me.voice.setRequestToSpeak(true);
Example
// Making the client cancel a request to speak
guild.members.me.voice.setRequestToSpeak(false);
// Making the client cancel a request to speak
guild.members.me.voice.setRequestToSpeak(false);
NameTypeOptionalDescription
requestToSpeakbooleanYesWhether or not the client is requesting to become a speaker.
setSuppressed(suppressed?):Promise<this>
Suppress/unsuppress the user. Only applicable for stage channels.
Example
// Making the client a speaker
guild.members.me.voice.setSuppressed(false);
// Making the client a speaker
guild.members.me.voice.setSuppressed(false);
Example
// Making the client an audience member
guild.members.me.voice.setSuppressed(true);
// Making the client an audience member
guild.members.me.voice.setSuppressed(true);
Example
// Inviting another user to speak
voiceState.setSuppressed(false);
// Inviting another user to speak
voiceState.setSuppressed(false);
Example
// Moving another user to the audience, or cancelling their invite to speak
voiceState.setSuppressed(true);
// Moving another user to the audience, or cancelling their invite to speak
voiceState.setSuppressed(true);
NameTypeOptionalDescription
suppressedbooleanYesWhether or not the user should be suppressed.
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
valueOf():string