Orca
A bot framework that is easy to reason about, easy to debug, and easy to use.
Public Attributes | List of all members
discord_voice Struct Reference

Discord Voice Connection handle, contain information about its active session. More...

#include <discord-voice-connections.h>

Collaboration diagram for discord_voice:
Collaboration graph
[legend]

Public Attributes

u64_snowflake_t guild_id
 the session guild id More...
 
u64_snowflake_t channel_id
 
char token [128]
 the session token More...
 
char new_token [128]
 the new session token after a voice region change More...
 
char new_url [512]
 the new url after a voice region change More...
 
char session_id [128]
 the session id More...
 
u64_snowflake_t bot_id
 the bot user id More...
 
struct websockets * ws
 
struct {
   bool   enable
 will attempt reconnecting if true
 
   unsigned char   attempt
 current reconnect attempt (resets to 0 when succesful)
 
   unsigned char   threshold
 max amount of reconnects before giving up
 
reconnect
 handle reconnect logic
 
bool is_resumable
 will attempt to resume session if connection shutsdown
 
bool is_redirect
 redirect to a different voice server
 
bool is_ready
 can start sending/receiving additional events to discord
 
struct {
   enum discord_voice_opcodes   opcode
 
   struct sized_buffer   event_data
 
payload
 
struct {
   u64_unix_ms_t   interval_ms
 
   u64_unix_ms_t   tstamp
 
hbeat
 
int ping_ms
 latency between client and websockets server, calculated by the interval between HEARTBEAT and HEARTBEAT_ACK
 
struct discordp_client
 pointer to client this struct is part of
 
bool shutdown
 if true shutdown websockets connection as soon as possible
 
struct {
   int   ssrc
 
   int   server_port
 
   char   server_ip [CEE_MAX_IP_ADDR_STR_LEN]
 
   char   digest [CEE_SHA1_STR_LEN]
 
   char   unique_key [128]
 
   int   audio_udp_pid
 
   uintmax_t   start_time
 
udp_service
 
struct discord_voice_cbsp_voice_cbs
 
uint64_t message_channel_id
 used to communicate the status of the bot state changes
 
int recv_interval
 Interval to divide the received packets. More...
 

Detailed Description

Discord Voice Connection handle, contain information about its active session.

Note
struct discord_voice are reused on a guild basis, because there can be only one active struct discord_voice session per guild.
See also
discord_join_vc()
discord_voice_get_vc()

Member Data Documentation

◆ bot_id

u64_snowflake_t discord_voice::bot_id

the bot user id

Note
obtained from on_voice_state_update()

◆ channel_id

u64_snowflake_t discord_voice::channel_id

the session channel id

Note
obtained from discord_join_vc()

◆ event_data

struct sized_buffer discord_voice::event_data

field 'd'

◆ guild_id

u64_snowflake_t discord_voice::guild_id

the session guild id

Note
obtained from discord_join_vc()

◆ interval_ms

u64_unix_ms_t discord_voice::interval_ms

fixed interval between heartbeats

◆ new_token

char discord_voice::new_token[128]

the new session token after a voice region change

Note
obtained from on_voice_server_update()

◆ new_url

char discord_voice::new_url[512]

the new url after a voice region change

Note
obtained from on_voice_server_update()

◆ opcode

enum discord_voice_opcodes discord_voice::opcode

field 'op'

◆ payload

struct { ... } discord_voice::payload

◆ recv_interval

int discord_voice::recv_interval

Interval to divide the received packets.

0 store in one file n store packets received every n minutes in a new file

◆ session_id

char discord_voice::session_id[128]

the session id

Note
obtained from on_voice_state_update()
obtained from on_voice_state_update()

◆ token

char discord_voice::token[128]

the session token

Note
obtained from on_voice_server_update()
obtained from on_voice_server_update()

◆ tstamp

u64_unix_ms_t discord_voice::tstamp

start pulse timestamp in milliseconds

◆ ws

struct websockets* discord_voice::ws

the websockets handle that binds to Discord Voice Connections


The documentation for this struct was generated from the following file: