Skip to main content
Version: v2.10.1

Types: VoiceState

note

In v2.10.1 the duplicate VoiceState interface was split into two properly named types: DiscordVoiceState and PlayerVoiceState. The VoiceState name is kept as a deprecated union alias for backwards compatibility.


DiscordVoiceState

Payload received from Discord's VOICE_STATE_UPDATE gateway event.

Property Type Description Optional
guild_idstringID of the guild the voice state belongs to.
user_idstringID of the user whose voice state is updated.
session_idstringSession ID used to identify the voice connection.
channel_idstring | nullID of the voice channel the user is in, or null if they disconnected.

PlayerVoiceState

Internal structure used by MagmaStream to send voice update payloads to the Lavalink node.

Property Type Description Optional
opstring = "voiceUpdate"Operation type identifying this as a voice update payload.
guildIdstringThe guild ID associated with the voice update.
eventVoiceServerThe voice server event containing the endpoint and token.
sessionIdstringThe session ID for the voice connection.
channelIdstringThe voice channel ID.

VoiceState

warning

VoiceState is deprecated as of v2.10.1. Use DiscordVoiceState or PlayerVoiceState instead.

Kept as a union type alias for backwards compatibility.

/** @deprecated Use DiscordVoiceState or PlayerVoiceState instead */
type VoiceState = DiscordVoiceState | PlayerVoiceState;