fix: use existing node if someone is already in the voice channel

This commit is contained in:
Zomatree
2025-03-25 20:37:06 +00:00
parent 8b5e085232
commit 091aa4705b
4 changed files with 26 additions and 9 deletions

View File

@@ -42,6 +42,10 @@ impl VoiceClient {
}
}
pub fn is_enabled(&self) -> bool {
!self.rooms.is_empty()
}
pub async fn from_revolt_config() -> Self {
let config = config().await;
@@ -89,8 +93,7 @@ impl VoiceClient {
Channel::TextChannel { voice: Some(voice), .. } => Some(Cow::Borrowed(voice)),
_ => None
}
.ok_or_else(|| create_error!(NotAVoiceChannel))?;
.ok_or_else(|| create_error!(NotAVoiceChannel))?;
room.client
.create_room(