feat: ability to join call with user
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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 = ();
|
||||
|
||||
Reference in New Issue
Block a user