From 7ff43e20a6a606409044cd9ba20043412cbc01d3 Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Tue, 10 Dec 2024 15:16:42 -0500 Subject: [PATCH] rename wealth to balance --- src/commands/gambling/wager.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/commands/gambling/wager.rs b/src/commands/gambling/wager.rs index 23a9724..fe0a2f6 100644 --- a/src/commands/gambling/wager.rs +++ b/src/commands/gambling/wager.rs @@ -17,11 +17,10 @@ pub async fn wager( } let mut tx = ctx.data().database.begin().await?; - let mut wealth = super::get_balance(ctx.author().id, &mut *tx).await?; + let mut balance = super::get_balance(ctx.author().id, &mut *tx).await?; - if wealth < amount { - ctx.reply(format!("You do not have enough tokens (**{}**) to wager this amount.", - wealth)).await?; + if balance < amount { + ctx.reply(format!("You do not have enough tokens (**{balance}**) to wager this amount.")).await?; return Ok(()); } @@ -57,16 +56,16 @@ pub async fn wager( if rand::thread_rng().gen_bool(chance) { let win = (amount as f64 * multiplier) as i32; - wealth += win; + balance += win; ctx.reply(format!("You just gained **{}** token(s)! You now have **{}**.", - win, wealth)).await?; + win, balance)).await?; } else { - wealth -= amount; + balance -= amount; ctx.reply(format!("You've lost **{}** token(s), you now have **{}**.", - amount, wealth)).await?; + amount, balance)).await?; } - super::change_balance(ctx.author().id, wealth, &mut *tx).await?; + super::change_balance(ctx.author().id, balance, &mut *tx).await?; tx.commit().await?;