glyde/model/voice_state

Who is in a voice channel. One per member on VOICE_STATE_UPDATE, and a partial one per member inside GUILD_CREATE.

Types

pub type VoiceState {
  VoiceState(
    guild_id: option.Option(id.Id(id.Guild)),
    channel_id: option.Option(id.Id(id.Channel)),
    user_id: id.Id(id.User),
    member: option.Option(member.GuildMember),
    session_id: String,
    deaf: Bool,
    mute: Bool,
    self_deaf: Bool,
    self_mute: Bool,
    self_stream: Bool,
    self_video: Bool,
    suppress: Bool,
    request_to_speak_timestamp: option.Option(String),
  )
}

Constructors

  • VoiceState(
      guild_id: option.Option(id.Id(id.Guild)),
      channel_id: option.Option(id.Id(id.Channel)),
      user_id: id.Id(id.User),
      member: option.Option(member.GuildMember),
      session_id: String,
      deaf: Bool,
      mute: Bool,
      self_deaf: Bool,
      self_mute: Bool,
      self_stream: Bool,
      self_video: Bool,
      suppress: Bool,
      request_to_speak_timestamp: option.Option(String),
    )

    Arguments

    guild_id

    Absent on the partial states inside GUILD_CREATE.

    channel_id

    None means the user left voice.

    member

    Absent outside a guild.

    session_id

    Opaque, not a snowflake. The voice gateway wants it back verbatim.

    deaf

    Server-side deafen, set by a moderator.

    mute

    Server-side mute, set by a moderator.

    self_stream

    The user is streaming with Go Live.

    suppress

    In a stage channel, this means the audience.

    request_to_speak_timestamp

    ISO-8601, when the user raised their hand in a stage channel.

Values

pub fn has_left(state: VoiceState) -> Bool

There is no leave event: a leave is a null channel_id.

Search Document