From 8fd92367099afa60a50dd04567f4dfc80c1715cc Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Mon, 9 Dec 2024 19:54:33 -0500 Subject: [PATCH] fix: giving yourself tokens --- 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 d4822ec..9cab9ec 100644 --- a/src/commands/gambling/give.rs +++ b/src/commands/gambling/give.rs @@ -14,6 +14,11 @@ pub async fn give(ctx: Context<'_>, user: serenity::User, #[min = 1] amount: i32 return Ok(()); } + if user == *ctx.author() { + ctx.reply("You cannot give yourself money!").await?; + return Ok(()); + } + let mut tx = ctx.data().database.begin().await?; let author_balance = super::get_balance(ctx.author().id, &mut *tx).await?;