Represents a connection to a voice channel. More...
#include "discordclient.h"
Public Member Functions | |
voiceconn ()=default | |
Construct a new voiceconn object. More... | |
voiceconn (class discord_client *o, snowflake _channel_id) | |
Construct a new voiceconn object. More... | |
~voiceconn () | |
Destroy the voiceconn object. More... | |
voiceconn & | connect (snowflake guild_id) |
Create websocket object and connect it. More... | |
voiceconn & | disconnect () |
Disconnect from the currently connected voice channel. More... | |
bool | is_active () |
return true if the connection is active (websocket exists) More... | |
bool | is_ready () |
return true if the connection is ready to connect (has hostname, token and session id) More... | |
Public Attributes | |
snowflake | channel_id |
Voice Channel ID. More... | |
std::string | session_id |
Voice Voice session ID. More... | |
std::string | token |
Voice websocket token. More... | |
class discord_voice_client * | voiceclient |
voice websocket client More... | |
std::string | websocket_hostname |
Websocket hostname for status. More... | |
Represents a connection to a voice channel.
A client can only connect to one voice channel per guild at a time, so these are stored in a map in the dpp::discord_client keyed by guild_id.
|
default |
Construct a new voiceconn object.
dpp::voiceconn::voiceconn | ( | class discord_client * | o, |
snowflake | _channel_id | ||
) |
Construct a new voiceconn object.
o | owner |
_channel_id | voice channel id |
dpp::voiceconn::~voiceconn | ( | ) |
Create websocket object and connect it.
Needs hostname, token and session_id to be set or does nothing.
guild_id | Guild to connect to the voice channel on |
References channel_id, dpp::discord_client::creator, is_active(), is_ready(), dpp::ll_debug, dpp::discord_client::log(), dpp::discord_voice_client::run(), dpp::unicode_emoji::thread, and voiceclient.
voiceconn & dpp::voiceconn::disconnect | ( | ) |
Disconnect from the currently connected voice channel.
References is_active(), and voiceclient.
Referenced by ~voiceconn().
bool dpp::voiceconn::is_active | ( | ) |
return true if the connection is active (websocket exists)
References voiceclient.
Referenced by connect(), and disconnect().
bool dpp::voiceconn::is_ready | ( | ) |
return true if the connection is ready to connect (has hostname, token and session id)
References session_id, token, and websocket_hostname.
Referenced by connect().
std::string dpp::voiceconn::session_id |
Voice Voice session ID.
Referenced by is_ready().
std::string dpp::voiceconn::token |
Voice websocket token.
Referenced by is_ready().
class discord_voice_client* dpp::voiceconn::voiceclient |
voice websocket client
Referenced by connect(), disconnect(), and is_active().
std::string dpp::voiceconn::websocket_hostname |
Websocket hostname for status.
Referenced by is_ready().