aboutsummaryrefslogtreecommitdiff
path: root/src/commands/game.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/game.rs')
-rw-r--r--src/commands/game.rs25
1 files changed, 13 insertions, 12 deletions
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::<FnvHashMap<_, _>>();
- let channel =
- pairs.get(&ctx.author().id).cloned().unwrap_or(CONFIG.discord.voice_channel());
+ 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::<FnvHashSet<_>>();
+ users = pairs
+ .iter()
+ .filter_map(|(uid, cid)| {
+ if *cid == channel {
+ DISCORD_MAP.get(uid).map(|s| s.to_lowercase())
+ } else {
+ None
+ }
+ })
+ .collect::<FnvHashSet<_>>();
+ }
}
users