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...
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()
Create websocket object and connect it. Needs hostname, token and session_id to be set or does nothing.
- Parameters
-
guild_id | Guild to connect to the voice channel on |
- Returns
- reference to self
- Note
- It can spawn a thread to establish the connection, so this is NOT a synchronous blocking call! You shouldn't call this directly. Use a wrapper function instead. e.g. dpp::guild::connect_member_voice
◆ disconnect()
Disconnect from the currently connected voice channel.
- Returns
- reference to self
◆ 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.