From ef056edf92b678265a4666e1f9405e3b0ce66a42 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Fri, 16 Aug 2024 21:14:30 -0400 Subject: repo: overhaul for multitenancy --- src/commands/today/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/commands/today/mod.rs') diff --git a/src/commands/today/mod.rs b/src/commands/today/mod.rs index 35059e5..e48983c 100644 --- a/src/commands/today/mod.rs +++ b/src/commands/today/mod.rs @@ -96,11 +96,18 @@ pub async fn today(ctx: PoiseContext<'_>, #[rest] _rest: Option) -> anyh let play_args = options.choose(&mut thread_rng()); if let Some(play_args) = play_args { + let Some(voice_channel) = util::best_voice_channel(ctx) else { + tracing::error!(?ctx, "couldn't find a relevant voice channel"); + util::react(ctx, '🔇').await?; + + return Ok(()); + }; + let (_sb, call) = songbird(ctx).await?; let mut call = call.lock().await; if call.current_channel().is_none() { - call.join(CONFIG.discord.voice_channel()).await?; + call.join(voice_channel).await?; } let client = { -- cgit v1.3.1