Compiler didn't like that

This commit is contained in:
barelyprofessional
2025-10-05 00:49:54 -05:00
parent f3781f9c18
commit d37401e1cd

View File

@@ -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);
}
}