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()
Construct a new voiceconn object.
- Parameters
-
| o | owner |
| request_callback | Function to ask a discord_client instance to make a request to Gateway to connect to a voice channel |
| guild_id | Guild to connect to the voice channel on |
| channel_id | voice channel id |
| enable_dave | True to enable DAVE E2EE |
◆ ~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.
- 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()
| voiceconn & dpp::voiceconn::disconnect |
( |
bool |
close = true | ) |
|
Disconnect from the currently connected voice channel.
- Parameters
-
| close | Whether to close connection |
- Returns
- reference to self
◆ is_active()
| bool dpp::voiceconn::is_active |
( |
| ) |
const |
return true if the connection is active (websocket exists)
- Returns
- true if has an active websocket
◆ is_ready()
| bool dpp::voiceconn::is_ready |
( |
| ) |
const |
return true if the connection is ready to connect (has hostname, token and session id)
- Returns
- true if ready to connect
◆ reassign_owner()
◆ request()
| voiceconn & dpp::voiceconn::request |
( |
bool |
session_invalid = true | ) |
|
◆ channel_id
◆ dave
| bool dpp::voiceconn::dave |
True to enable DAVE E2EE.
- Warning
- This is an EXPERIMENTAL feature!
◆ guild_id
Guild to connect to the voice channel on.
◆ 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.