Skip to content

Commit

Permalink
add dave to guild_member_connect
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 6, 2024
1 parent cef07fb commit 936ac59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/dpp/guild.h
Original file line number Diff line number Diff line change
Expand Up @@ -1288,12 +1288,14 @@ class DPP_EXPORT guild : public managed, public json_interface<guild> {
* @param user_id User id to join
* @param self_mute True if the bot should mute itself
* @param self_deaf True if the bot should deafen itself
* @param dave True to enable DAVE E2EE
* @warning DAVE is EXPERIMENTAL and subject to change.
* @return True if the user specified is in a vc, false if they aren't
* @note This is NOT a synchronous blocking call! The bot isn't instantly ready to send or listen for audio,
* as we have to wait for the connection to the voice server to be established!
* e.g. wait for dpp::cluster::on_voice_ready event, and then send the audio within that event.
*/
bool connect_member_voice(snowflake user_id, bool self_mute = false, bool self_deaf = false);
bool connect_member_voice(snowflake user_id, bool self_mute = false, bool self_deaf = false, bool dave = false);

/**
* @brief Get the banner url of the guild if it have one, otherwise returns an empty string
Expand Down
4 changes: 2 additions & 2 deletions src/dpp/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ permission guild::permission_overwrites(const guild_member &member, const channe
return permissions;
}

bool guild::connect_member_voice(snowflake user_id, bool self_mute, bool self_deaf) {
bool guild::connect_member_voice(snowflake user_id, bool self_mute, bool self_deaf, bool dave) {
for (auto & c : channels) {
channel* ch = dpp::find_channel(c);
if (!ch || (!ch->is_voice_channel() && !ch->is_stage_channel())) {
Expand All @@ -958,7 +958,7 @@ bool guild::connect_member_voice(snowflake user_id, bool self_mute, bool self_de
auto vsi = vcmembers.find(user_id);
if (vsi != vcmembers.end()) {
if (vsi->second.shard) {
vsi->second.shard->connect_voice(this->id, vsi->second.channel_id, self_mute, self_deaf);
vsi->second.shard->connect_voice(this->id, vsi->second.channel_id, self_mute, self_deaf, dave);
return true;
}
}
Expand Down

0 comments on commit 936ac59

Please sign in to comment.