From f5f0ba63231ef54638ea8ec6f489c52824597f4b Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Fri, 1 May 2026 19:53:43 -0500 Subject: [PATCH] Added an option to get your exact balance to help deal with rounding issues --- .../Commands/Kasino/KasinoUserCommands.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/KfChatDotNetBot/Commands/Kasino/KasinoUserCommands.cs b/KfChatDotNetBot/Commands/Kasino/KasinoUserCommands.cs index 800b4fe..07c4671 100644 --- a/KfChatDotNetBot/Commands/Kasino/KasinoUserCommands.cs +++ b/KfChatDotNetBot/Commands/Kasino/KasinoUserCommands.cs @@ -18,7 +18,8 @@ public class GetBalanceCommand : ICommand { public List Patterns => [ new Regex("^balance", RegexOptions.IgnoreCase), - new Regex("^bal$", RegexOptions.IgnoreCase) + new Regex("^bal$", RegexOptions.IgnoreCase), + new Regex("^bal exact$", RegexOptions.IgnoreCase) ]; public string? HelpText => "Get your gamba balance"; public UserRight RequiredRight => UserRight.Loser; @@ -30,8 +31,17 @@ public class GetBalanceCommand : ICommand CancellationToken ctx) { var gambler = await Money.GetGamblerEntityAsync(user.Id, ct: ctx); - await botInstance.SendChatMessageAsync( - $"{user.FormatUsername()}, your balance is {await gambler!.Balance.FormatKasinoCurrencyAsync()}", true); + if (message.MessageRawHtmlDecoded.EndsWith("exact")) + { + await botInstance.SendChatMessageAsync( + $"{user.FormatUsername()}, your balance is {gambler!.Balance}", true); + } + else + { + await botInstance.SendChatMessageAsync( + $"{user.FormatUsername()}, your balance is {await gambler!.Balance.FormatKasinoCurrencyAsync()}", true); + } + if (botInstance.BotServices.KasinoShop != null) {