|
Orca
A bot framework that is easy to reason about, easy to debug, and easy to use.
|
File containing internal functions and datatypes for Voice Connections. More...
#include <time.h>#include <pthread.h>#include "cee-data-sizes.h"

Go to the source code of this file.
Classes | |
| struct | discord_voice_cbs |
| struct | discord_voice |
| Discord Voice Connection handle, contain information about its active session. More... | |
Typedefs | |
| typedef void(* | voice_idle_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot) |
| Idle callback. More... | |
| typedef void(* | voice_speaking_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const u64_snowflake_t user_id, const int speaking, const int delay, const int ssrc) |
| Voice Speaking callback. More... | |
| typedef void(* | voice_client_disconnect_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const u64_snowflake_t user_id) |
| Voice Client Disconnect callback. More... | |
| typedef void(* | voice_codec_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const char audio_codec[], const char video_codec[]) |
| Voice Codec callback. More... | |
Enumerations | |
| enum | discord_join_vc_status { DISCORD_JOIN_VC_ERROR = 0, DISCORD_JOIN_VC_JOINED = 1, DISCORD_JOIN_VC_EXHAUST_CAPACITY, DISCORD_JOIN_VC_ALREADY_JOINED } |
Functions | |
| void | discord_voice_set_on_idle (struct discord_voice *vc, voice_idle_cb *callback) |
| Set a callback that triggers at every event-loop iteration. More... | |
| enum discord_join_vc_status | discord_join_vc (struct discord *client, struct discord_message *msg, u64_snowflake_t guild_id, u64_snowflake_t channel_id, bool self_mute, bool self_deaf) |
| Send a Voice State Update to Discord. More... | |
| void | discord_send_speaking (struct discord_voice *vc, enum discord_voice_speaking_flags flag, int delay) |
| Notify clients that you are speaking or have stopped speaking. More... | |
| void | _discord_on_voice_state_update (struct discord *client, struct discord_voice_state *vs) |
| Update the voice session with a new session_id. More... | |
| void | _discord_on_voice_server_update (struct discord *client, u64_snowflake_t guild_id, char token[], char endpoint[]) |
| Update the voice session with a new token and url. More... | |
| void | discord_voice_shutdown (struct discord_voice *vc) |
| Gracefully exits a ongoing Discord Voice connection. More... | |
| void | discord_voice_reconnect (struct discord_voice *vc, bool resume) |
| Gracefully reconnect a ongoing Discord Voice connection. More... | |
| bool | discord_voice_is_alive (struct discord_voice *vc) |
| Check if a Discord Voice connection is alive. More... | |
| void | discord_voice_connections_init (struct discord *client) |
| Initialize the fields of a Discord Voice Connections handle. More... | |
File containing internal functions and datatypes for Voice Connections.
| typedef void(* voice_client_disconnect_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const u64_snowflake_t user_id) |
Voice Client Disconnect callback.
| typedef void(* voice_codec_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const char audio_codec[], const char video_codec[]) |
Voice Codec callback.
| typedef void(* voice_idle_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot) |
Idle callback.
Runs on every WebSockets loop iteration, no trigger required
| typedef void(* voice_speaking_cb) (struct discord *client, struct discord_voice *vc, const struct discord_user *bot, const u64_snowflake_t user_id, const int speaking, const int delay, const int ssrc) |
Voice Speaking callback.
| void _discord_on_voice_server_update | ( | struct discord * | client, |
| u64_snowflake_t | guild_id, | ||
| char | token[], | ||
| char | endpoint[] | ||
| ) |
Update the voice session with a new token and url.
| client | the client created with discord_init() |
| guild_id | the guild that houses the voice channel |
| token | the unique token identifier |
| endpoint | unique wss url received |
| void _discord_on_voice_state_update | ( | struct discord * | client, |
| struct discord_voice_state * | vs | ||
| ) |
Update the voice session with a new session_id.
| client | the client created with discord_init() |
| vs | the voice state that has been updated |
| enum discord_join_vc_status discord_join_vc | ( | struct discord * | client, |
| struct discord_message * | msg, | ||
| u64_snowflake_t | guild_id, | ||
| u64_snowflake_t | channel_id, | ||
| bool | self_mute, | ||
| bool | self_deaf | ||
| ) |
Send a Voice State Update to Discord.
Necessary to connect to the voice server. When succesful a new voice connection instance will start
| client | the client created with discord_init() |
| msg |
| guild_id | the guild that houses the voice channel |
| channel_id | the voice channel the client wants to connect to |
| self_mute | true will join as mute |
| self_deaf | true will join as deaf |
| void discord_send_speaking | ( | struct discord_voice * | vc, |
| enum discord_voice_speaking_flags | flag, | ||
| int | delay | ||
| ) |
Notify clients that you are speaking or have stopped speaking.
| vc | the VC obtained with discord_join_vc() |
| flag | |
| delay | Should be set to 0. |
| void discord_voice_connections_init | ( | struct discord * | client | ) |
Initialize the fields of a Discord Voice Connections handle.
| client | the client created with discord_init() |
| bool discord_voice_is_alive | ( | struct discord_voice * | vc | ) |
Check if a Discord Voice connection is alive.
| vc | the VC obtained with discord_join_vc() |
| void discord_voice_reconnect | ( | struct discord_voice * | vc, |
| bool | resume | ||
| ) |
Gracefully reconnect a ongoing Discord Voice connection.
| vc | the VC obtained with discord_join_vc() |
| resume | true to attempt to resume to previous session, false reconnect to a fresh session |
| void discord_voice_set_on_idle | ( | struct discord_voice * | vc, |
| voice_idle_cb * | callback | ||
| ) |
Set a callback that triggers at every event-loop iteration.
| vc | the VC obtained with discord_join_vc() |
| callback | the callback that will be executed |
| void discord_voice_shutdown | ( | struct discord_voice * | vc | ) |
Gracefully exits a ongoing Discord Voice connection.
| vc | the VC obtained with discord_join_vc() |
1.8.17