#[non_exhaustive]pub struct VoiceState {Show 13 fields
pub guild_id: Option<GuildId>,
pub channel_id: Option<ChannelId>,
pub user_id: UserId,
pub member: Option<Box<Member>>,
pub session_id: CompactString,
pub deaf: bool,
pub mute: bool,
pub self_deaf: bool,
pub self_mute: bool,
pub self_stream: bool,
pub self_video: bool,
pub suppress: bool,
pub request_to_speak_timestamp: Option<Timestamp>,
}Expand description
A user’s voice state: which voice channel they are in and whether they are muted, deafened, streaming, ….
Received in GUILD_CREATE (without guild_id and member), VOICE_STATE_UPDATE and from
the voice state endpoints. Absent booleans are false (C-023; the docs’ example omits
self_video).
discord.js counterpart: VoiceState.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.guild_id: Option<GuildId>The guild (absent in GUILD_CREATE, where the guild is known).
channel_id: Option<ChannelId>The connected channel (None once the user left).
user_id: UserIdThe user.
member: Option<Box<Member>>The user’s member object (absent in GUILD_CREATE).
session_id: CompactStringThe voice session’s ID.
deaf: boolWhether the server deafened the user.
mute: boolWhether the server muted the user.
self_deaf: boolWhether the user deafened themselves.
self_mute: boolWhether the user muted themselves.
self_stream: boolWhether the user is streaming with “Go Live”.
self_video: boolWhether the user’s camera is on.
suppress: boolWhether the user’s permission to speak is denied (stage audience members).
request_to_speak_timestamp: Option<Timestamp>When the user asked to speak in a stage.