diff --git a/BoosterManager/Data/ItemListing.cs b/BoosterManager/Data/ItemListing.cs index 2f4ed64..ffe8afc 100644 --- a/BoosterManager/Data/ItemListing.cs +++ b/BoosterManager/Data/ItemListing.cs @@ -1,7 +1,7 @@ using System; -using System.Text.Json; using System.Text.Json.Nodes; using ArchiSteamFarm.Core; +using ArchiSteamFarm.Helpers.Json; namespace BoosterManager { internal sealed class ItemListing { @@ -38,19 +38,19 @@ internal ItemListing(JsonObject listing) { throw new InvalidOperationException(); } - uint? appID = listing["asset"]?["appid"]?.GetValue(); + uint? appID = listing["asset"]?["appid"]?.ToString().ToJsonObject(); if (appID == null) { ASF.ArchiLogger.LogNullError(appID); throw new InvalidOperationException(); } - ulong? contextID = listing["asset"]?["contextid"]?.GetValue(); + ulong? contextID = listing["asset"]?["contextid"]?.ToString().ToJsonObject(); if (contextID == null) { ASF.ArchiLogger.LogNullError(contextID); throw new InvalidOperationException(); } - ulong? classID = listing["asset"]?["classid"]?.GetValue(); + ulong? classID = listing["asset"]?["classid"]?.ToString().ToJsonObject(); if (classID == null) { ASF.ArchiLogger.LogNullError(classID); throw new InvalidOperationException(); diff --git a/BoosterManager/Handlers/MarketHandler.cs b/BoosterManager/Handlers/MarketHandler.cs index c2839a4..997d77b 100644 --- a/BoosterManager/Handlers/MarketHandler.cs +++ b/BoosterManager/Handlers/MarketHandler.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text.Json.Nodes; using System.Threading.Tasks; +using ArchiSteamFarm.Helpers.Json; using ArchiSteamFarm.Localization; using ArchiSteamFarm.Steam; using ArchiSteamFarm.Steam.Data; @@ -42,7 +43,7 @@ internal static async Task GetValue(Bot bot, uint subtractFrom = 0) { uint listingsValue = 0; foreach (JsonObject listing in listings.Values) { - uint? price = listing["price"]?.GetValue(); + uint? price = listing["price"]?.ToString().ToJsonObject(); if (price == null) { bot.ArchiLogger.LogNullError(price); @@ -141,7 +142,7 @@ internal static async Task FindAndRemoveListings(Bot bot, List(); + ulong? listingid = listing["listingid"]?.ToString().ToJsonObject(); if (listingid == null) { bot.ArchiLogger.LogNullError(listingid);