feat: update to songbird 0.6, make joining calls work by spawning everything as required in songbird's documentation

This commit is contained in:
2026-04-07 23:08:20 -04:00
parent 1bd8b9b203
commit 288a784870
6 changed files with 1059 additions and 48 deletions

View File

@@ -82,7 +82,7 @@ fn get_guild_and_channel_id(
Ok((guild_id, channel_id))
}
#[tracing::instrument]
#[tracing::instrument(skip(state))]
pub async fn handle(state: State, interaction: Interaction) {
let vcs = state.vcs;
@@ -126,13 +126,22 @@ pub async fn handle(state: State, interaction: Interaction) {
.await
.expect("TODO");
let call = tokio::spawn({
let songbird = state.songbird.clone();
async move { songbird.join(guild_id, channel_id).await }
})
.await
.unwrap()
.expect("TODO");
let call = loop {
tracing::error!("TODO: about to try joining");
match state.songbird.join(guild_id, channel_id).await {
Ok(call) => break call,
Err(error) => {
tracing::error!(?error, "I'm still here");
if error.should_leave_server() {
state.songbird.leave(guild_id).await.expect("TODO");
} else if error.should_reconnect_driver() {
todo!();
}
}
}
};
let channel_mention = format!("<#{channel_id}>");
@@ -150,4 +159,5 @@ pub async fn handle(state: State, interaction: Interaction) {
tracing::error!(?call, "TODO");
let call_guard = call.lock().await;
tracing::error!(?call_guard, "TODO");
}