From 8f879075203b36dd0b3d95d225bbe97b312d9f8d Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Mon, 9 Dec 2024 19:46:50 -0500 Subject: [PATCH] fix: giving negative amount of tokens to someone --- src/commands/gambling/give.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/gambling/give.rs b/src/commands/gambling/give.rs index 03381fb..d4822ec 100644 --- a/src/commands/gambling/give.rs +++ b/src/commands/gambling/give.rs @@ -9,6 +9,11 @@ pub async fn give(ctx: Context<'_>, user: serenity::User, #[min = 1] amount: i32 return Ok(()); } + if amount < 1 { + ctx.reply("You cannot give someone a negative amount of money (that's stealing!).").await?; + return Ok(()); + } + let mut tx = ctx.data().database.begin().await?; let author_balance = super::get_balance(ctx.author().id, &mut *tx).await?;