update to show net balance change per request (#48)

update to show net balance change per request
This commit is contained in:
alogindtractor
2026-01-14 07:36:01 -08:00
committed by GitHub
parent 8be1ec0f41
commit 17ce32a69c

View File

@@ -138,9 +138,12 @@ public class SlotsCommand : ICommand
decimal rawWinnings = winnings;
winnings -= wager*spins;
bool netwin = winnings > 0;
string winstr = netwin ? "" : "-";
newBalance = await Money.NewWagerAsync(gambler.Id, wager*spins, winnings, WagerGame.Slots, ct: ctx);
winnings = Math.Abs(winnings);
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won[/color] {await rawWinnings.FormatKasinoCurrencyAsync()} with {spins} spins! Current balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter: TimeSpan.FromSeconds(30));
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]won[/color] {await rawWinnings.FormatKasinoCurrencyAsync()} from {spins} spins worth {await wager.FormatKasinoCurrencyAsync()}! Net: {winstr}{winnings.FormatKasinoCurrencyAsync()} Current balance: {await newBalance.FormatKasinoCurrencyAsync()}", true, autoDeleteAfter: TimeSpan.FromSeconds(30));
}
public class WinDetail
{