Skip to content

Commit

Permalink
Fix value command not including pending wallet balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Jul 1, 2024
1 parent 11184cc commit 35b8089
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BoosterManager/Handlers/MarketHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ internal static async Task<string> GetValue(Bot bot, uint subtractFrom = 0) {
return Strings.MarketListingsFetchFailed;
}

var value = (listingsValue + bot.WalletBalance + bot.WalletBalanceDelayed) / 100.0;

if (subtractFrom != 0) {
return Commands.FormatBotResponse(bot, String.Format(Strings.AccountValueRemaining, String.Format("{0:#,#0.00}", subtractFrom - ((listingsValue + bot.WalletBalance) / 100.0)), bot.WalletCurrency.ToString()));
return Commands.FormatBotResponse(bot, String.Format(Strings.AccountValueRemaining, String.Format("{0:#,#0.00}", subtractFrom - value), bot.WalletCurrency.ToString()));
}

return Commands.FormatBotResponse(bot, String.Format(Strings.AccountValue, String.Format("{0:#,#0.00}", (listingsValue + bot.WalletBalance) / 100.0), bot.WalletCurrency.ToString()));
return Commands.FormatBotResponse(bot, String.Format(Strings.AccountValue, String.Format("{0:#,#0.00}", value), bot.WalletCurrency.ToString()));
}

private static async Task<uint?> GetMarketListingsValue(Bot bot) {
Expand Down

0 comments on commit 35b8089

Please sign in to comment.