feat: ability to join call with user

This commit is contained in:
2026-04-02 15:38:05 -04:00
parent 7f569629db
commit 663586a65c
3 changed files with 57 additions and 24 deletions

View File

@@ -33,6 +33,16 @@ pub async fn handle(state: State, interaction: Interaction) {
let guild_vcs = vcs.get(&guild_id).expect("TODO");
tracing::error!(?guild_vcs, "TODO");
let user_in_vc_data = guild_vcs.get_left_and_data_for(&user_id);
let (&channel_id, user_in_vc_data) = guild_vcs.get_left_and_data_for(&user_id).expect("TODO");
tracing::error!(?user_in_vc_data, "TODO");
let call = tokio::spawn({
let songbird = state.songbird.clone();
async move { songbird.join(guild_id, channel_id).await }
})
.await
.unwrap()
.expect("TODO");
tracing::error!(?call, "TODO");
}

View File

@@ -2,6 +2,7 @@ use std::{fmt::Debug, sync::Arc};
use futures::future::BoxFuture;
use patricia_tree::StringPatriciaMap;
use songbird::Songbird;
use twilight_model::application::{command::Command, interaction::Interaction};
use crate::VCs;
@@ -13,6 +14,7 @@ mod opt_out;
#[derive(Debug, Clone)]
pub struct State {
pub vcs: Arc<VCs>,
pub songbird: Arc<Songbird>,
}
type Return = ();