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/game.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/commands/game.rs') diff --git a/src/commands/game.rs b/src/commands/game.rs index 5c51da6..78c08ee 100644 --- a/src/commands/game.rs +++ b/src/commands/game.rs @@ -288,19 +288,20 @@ async fn _game( .filter_map(|(uid, voice)| voice.channel_id.map(|cid| (*uid, cid))) .collect::>(); - let channel = - pairs.get(&ctx.author().id).cloned().unwrap_or(CONFIG.discord.voice_channel()); - - users = pairs - .iter() - .filter_map(|(uid, cid)| { - if *cid == channel { - DISCORD_MAP.get(uid).map(|s| s.to_lowercase()) - } else { - None - } - }) - .collect::>(); + if let Some(channel) = pairs.get(&ctx.author().id).cloned() { + tracing::debug!("identified user channel"); + + users = pairs + .iter() + .filter_map(|(uid, cid)| { + if *cid == channel { + DISCORD_MAP.get(uid).map(|s| s.to_lowercase()) + } else { + None + } + }) + .collect::>(); + } } users -- cgit v1.3.1