Try to join the caller's channel before playing

This commit is contained in:
Alex Page 2022-01-20 22:05:45 -05:00
parent 37885e5572
commit 41296e003b

View file

@ -83,6 +83,11 @@ pub async fn play(ctx: &mut Context, command: &ApplicationCommandInteraction) ->
.expect("Songbird Voice client placed in at initialisation.")
.clone();
// Try to join the caller's channel
if manager.get(guild_id).is_none() {
join(ctx, command).await;
}
if let Some(handler_lock) = manager.get(guild_id) {
let mut handler = handler_lock.lock().await;