aboutsummaryrefslogtreecommitdiff
path: root/src/commands/today/mod.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2024-08-16 21:14:30 -0400
committerNathan Perry <np@nathanperry.dev>2024-08-16 21:15:07 -0400
commitef056edf92b678265a4666e1f9405e3b0ce66a42 (patch)
treeb3766d47ae2898d2a46f108de4e2be0ede6c400b /src/commands/today/mod.rs
parentc5ce454319a7d54d3967c6ea7695543e943a37b2 (diff)
repo: overhaul for multitenancy
Diffstat (limited to 'src/commands/today/mod.rs')
-rw-r--r--src/commands/today/mod.rs9
1 files changed, 8 insertions, 1 deletions
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<String>) -> 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 = {