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.
More...
#include <discordclient.h>
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.
◆ voiceconn() [1/2]
dpp::voiceconn::voiceconn |
( |
| ) |
|
|
default |
Construct a new voiceconn object.
◆ voiceconn() [2/2]
Construct a new voiceconn object.
- Parameters
-
o | owner |
_channel_id | voice channel id |
◆ ~voiceconn()
dpp::voiceconn::~voiceconn |
( |
| ) |
|
Destroy the voiceconn object.
◆ connect()
void dpp::voiceconn::connect |
( |
snowflake |
guild_id | ) |
|
Create websocket object and connect it. Needs hosname, token and session_id to be set or does nothing.
- Parameters
-
guild_id | Guild to connect to the voice channel on |
◆ disconnect()
void dpp::voiceconn::disconnect |
( |
| ) |
|
Disconnect from the currently connected voice channel.
◆ is_active()
bool dpp::voiceconn::is_active |
( |
| ) |
|
return true if the connection is active (websocket exists)
- Returns
- true if has an active websocket
◆ is_ready()
bool dpp::voiceconn::is_ready |
( |
| ) |
|
return true if the connection is ready to connect (has hostname, token and session id)
- Returns
- true if ready to connect
◆ channel_id
◆ session_id
std::string dpp::voiceconn::session_id |
◆ token
std::string dpp::voiceconn::token |
◆ voiceclient
◆ websocket_hostname
std::string dpp::voiceconn::websocket_hostname |
Websocket hostname for status.