spectacles_model/voice.rs
1//! Structures for interfacing with Discord's voice related features.
2use crate::guild::GuildMember;
3use crate::snowflake::Snowflake;
4
5/// Represents a user's voice connection status.
6#[derive(Serialize, Deserialize, Debug, Clone, Default)]
7pub struct VoiceState {
8 /// The guild ID of the guild this voice state belongs to.
9 #[serde(default)]
10 pub guild_id: Snowflake,
11 /// The channel ID of the channel the user is connected to.
12 pub channel_id: Option<Snowflake>,
13 /// The user ID of the user this voice state belongs to.
14 pub user_id: Snowflake,
15 /// The guild member that this voice state belongs to.
16 #[serde(default)]
17 pub member: GuildMember,
18 /// The session ID of this voice state.
19 pub session_id: String,
20 /// Whether or not the user is deafened on the server.
21 pub deaf: bool,
22 /// Whether or not the user is muted on the server.
23 pub mute: bool,
24 /// Whether or not the user is locally deaf.
25 pub self_deaf: bool,
26 /// Whether or not the user is locally muted.
27 pub self_mute: bool,
28 /// Whether or not the user was muted by the current user.
29 pub suppress: bool
30}
31
32/// Represents a Discord voice region.
33#[derive(Serialize, Deserialize, Debug, Clone)]
34pub struct VoiceRegion {
35 /// The ID of this voice region.
36 pub id: String,
37 /// The name of this voice region.
38 pub name: String,
39 /// Whether or not this server is a VIP-only server.
40 pub vip: bool,
41 /// Whetehr or not this region is the closest to the user's client.
42 pub optimal: bool,
43 /// Whether or not this voice region has been deprecated.
44 pub deprecated: bool,
45 /// Whether or not this is a custom voice region.
46 pub custom: bool
47}