diff options
| author | Nathan Perry <avaglir@gmail.com> | 2019-03-08 18:49:46 -0500 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2019-03-08 18:49:46 -0500 |
| commit | c0142ef5b263be339811314b07d5a0fcb60aa1c7 (patch) | |
| tree | c27cb3ea994ad6bc78917256fa844208fc58cb4f | |
| parent | 87f10c3fb0c9f0d5794136124690bee5c5bef765 (diff) | |
slight usability improvements
| -rw-r--r-- | src/game.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game.rs b/src/game.rs index b723cd4..9569c17 100644 --- a/src/game.rs +++ b/src/game.rs @@ -107,6 +107,8 @@ fn game(_ctx: &mut Context, msg: &Message, args: Args) -> Result<()> { }) .collect::<FnvHashSet<_>>(); + let inferred = users.len() == 0; + if users.len() == 0 { let pairs = guild .voice_states @@ -128,7 +130,7 @@ fn game(_ctx: &mut Context, msg: &Message, args: Args) -> Result<()> { .collect::<FnvHashSet<_>>(); } - if users.len() < 2 { + if inferred && users.len() < 2 || !inferred && users.len() < 1 { info!("too few known users to make game comparison"); send(msg.channel_id, "yer too lonely", msg.tts)?; return Ok(()); @@ -225,6 +227,5 @@ fn game(_ctx: &mut Context, msg: &Message, args: Args) -> Result<()> { use itertools::Itertools; let games_formatted = games_in_common.iter().join("\n"); - send(msg.channel_id, &format!("games in common:\n{}", games_formatted), msg.tts) + send(msg.channel_id, &games_formatted, msg.tts) } - |
