diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index ca26408..680c944 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,6 +140,8 @@ async fn handle_event( ) .await .unwrap(); + + return Ok(()); } let data = create.data.as_ref().unwrap(); @@ -290,9 +292,16 @@ async fn add_points( } } + if users.len() == 0 { + bail!("No users mentioned! Who do we add points to?") + } + let (points, points_display, points_verb) = match points { Some(p) if p > 0 => (p, p, "added to"), - Some(p) if p <= 0 => (p, -p, "removed from"), + Some(p) if p < 0 => (p, -p, "removed from"), + Some(0) => { + return success!("adding 0 points is a no-operation, so I won't doing anything"); + } Some(_) | None => unreachable!(), }; |