From d37401e1cd46336e72f86140431708387714ffab Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 5 Oct 2025 00:49:54 -0500 Subject: [PATCH] Compiler didn't like that --- KfChatDotNetBot/Commands/KasinoGambaCommands.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Commands/KasinoGambaCommands.cs b/KfChatDotNetBot/Commands/KasinoGambaCommands.cs index 6726f75..580e0ac 100644 --- a/KfChatDotNetBot/Commands/KasinoGambaCommands.cs +++ b/KfChatDotNetBot/Commands/KasinoGambaCommands.cs @@ -43,19 +43,22 @@ public class GuessWhatNumberCommand : ICommand } var answer = Money.GetRandomNumber(gambler, 1, 10); + decimal newBalance; if (guess == answer) { var effect = wager * 9; await Money.NewWagerAsync(gambler.Id, wager, effect, WagerGame.GuessWhatNumber, ct: ctx); + newBalance = gambler.Balance + effect; await botInstance.SendChatMessageAsync( - $"{user.FormatUsername()}, correct! You won {await effect.FormatKasinoCurrencyAsync()} and your balance is now {await (gambler.Balance + effect).FormatKasinoCurrencyAsync()}", + $"{user.FormatUsername()}, correct! You won {await effect.FormatKasinoCurrencyAsync()} and your balance is now {await newBalance.FormatKasinoCurrencyAsync()}", true); return; } await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.GuessWhatNumber, ct: ctx); + newBalance = gambler.Balance - wager; await botInstance.SendChatMessageAsync( - $"{user.FormatUsername()}, wrong! I was thinking of {answer}. Your balance is now {await (gambler.Balance - wager).FormatKasinoCurrencyAsync()}", + $"{user.FormatUsername()}, wrong! I was thinking of {answer}. Your balance is now {await newBalance.FormatKasinoCurrencyAsync()}", true); } } \ No newline at end of file