Nostrum.Struct.VoiceWSState (nostrum v0.11.0-dev)

View Source

Struct representing the current Voice WS state.

Summary

Types

The channel id that this voice websocket state applies to

PID of the :gun worker connected to the websocket

PID of the connection process

The consumer callback module. See Nostrum.Consumer.

Encryption mode selected for voice channel

Gateway URL

The guild id that this voice websocket state applies to

Whether or not the last heartbeat sent was ACK'd

Interval at which heartbeats are sent

Time ref for the heartbeat

Whether the session has been identified

The time the last heartbeat was acknowledged, will be nil if a heartbeat hasn't been ACK'd yet

The time the last heartbeat was sent, if a heartbeat hasn't been sent it will be the time the websocket process was started

The secret key for audio encryption

Sequence number for buffering server-sent events

The session id

A mapping of RTP SSRC (synchronization source) to user id

Stream reference for :gun

t()

The session token

Types

channel_id()

(since 0.6.0)
@type channel_id() :: Nostrum.Struct.Channel.id()

The channel id that this voice websocket state applies to

conn()

@type conn() :: pid()

PID of the :gun worker connected to the websocket

conn_pid()

@type conn_pid() :: pid()

PID of the connection process

consumer()

(since 0.11.0)
@type consumer() :: module()

The consumer callback module. See Nostrum.Consumer.

encryption_mode()

@type encryption_mode() :: Nostrum.Voice.Crypto.cipher()

Encryption mode selected for voice channel

gateway()

@type gateway() :: String.t()

Gateway URL

guild_id()

@type guild_id() :: Nostrum.Struct.Guild.id()

The guild id that this voice websocket state applies to

heartbeat_ack()

@type heartbeat_ack() :: boolean()

Whether or not the last heartbeat sent was ACK'd

heartbeat_interval()

@type heartbeat_interval() :: integer() | nil

Interval at which heartbeats are sent

heartbeat_ref()

@type heartbeat_ref() :: :timer.tref() | nil

Time ref for the heartbeat

identified()

@type identified() :: boolean()

Whether the session has been identified

last_heartbeat_ack()

@type last_heartbeat_ack() :: DateTime.t() | nil

The time the last heartbeat was acknowledged, will be nil if a heartbeat hasn't been ACK'd yet

last_heartbeat_send()

@type last_heartbeat_send() :: DateTime.t()

The time the last heartbeat was sent, if a heartbeat hasn't been sent it will be the time the websocket process was started

secret_key()

(since 0.6.0)
@type secret_key() :: binary() | nil

The secret key for audio encryption

seq()

@type seq() :: integer()

Sequence number for buffering server-sent events

session()

@type session() :: String.t()

The session id

ssrc_map()

(since 0.6.0)
@type ssrc_map() :: %{required(integer()) => Nostrum.Struct.User.id()}

A mapping of RTP SSRC (synchronization source) to user id

This map can be used to identify the user who generated the incoming audio data when an RTP packet is received.

stream()

@type stream() :: :gun.stream_ref()

Stream reference for :gun

t()

@type t() :: %Nostrum.Struct.VoiceWSState{
  channel_id: channel_id(),
  conn: conn(),
  conn_pid: conn_pid(),
  consumer: consumer(),
  encryption_mode: encryption_mode(),
  gateway: gateway(),
  guild_id: guild_id(),
  heartbeat_ack: heartbeat_ack(),
  heartbeat_interval: heartbeat_interval(),
  heartbeat_ref: heartbeat_ref(),
  identified: identified(),
  last_heartbeat_ack: last_heartbeat_ack(),
  last_heartbeat_send: last_heartbeat_send(),
  secret_key: secret_key(),
  seq: seq(),
  session: session(),
  ssrc_map: ssrc_map(),
  stream: stream(),
  token: token()
}

token()

@type token() :: String.t()

The session token