From c4b2fbee7308fa6356ac63af51aaa6ea66c27357 Mon Sep 17 00:00:00 2001 From: Fabio Gaming Date: Sun, 2 Jun 2024 14:45:15 +0200 Subject: [PATCH] fixed #43 [ # ] get_from_code & get_from_id now pass linkInfoV2 as root JSON key into the deserializer [ # ] LastMessageSummary.MediaType is now an int? instead of string [ # ] WalletInfo.TotalCoins is now a float? instead of int? because Amino API is weird (there literally is a totalCoinsFloat value????) [ # ] SubClient.send_activity_time now sends optInAdsFlags instead of OptInAdsFlags --- Amino.NET/Client.cs | 4 ++-- Amino.NET/Objects/LastChatMessageSummary.cs | 2 +- Amino.NET/Objects/WalletInfo.cs | 2 +- Amino.NET/SubClient.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Amino.NET/Client.cs b/Amino.NET/Client.cs index 1eeddff..a2da4fc 100644 --- a/Amino.NET/Client.cs +++ b/Amino.NET/Client.cs @@ -1856,7 +1856,7 @@ public Objects.FromCode get_from_code(string aminoUrl) var response = client.ExecuteGet(request); if ((int)response.StatusCode != 200) { throw new Exception(response.Content); } if (Debug) { Trace.WriteLine(response.Content); } - return System.Text.Json.JsonSerializer.Deserialize(JsonDocument.Parse(response.Content).RootElement.GetRawText()); + return System.Text.Json.JsonSerializer.Deserialize(JsonDocument.Parse(response.Content).RootElement.GetProperty("linkInfoV2").GetRawText()); } /// @@ -1889,7 +1889,7 @@ public Objects.FromCode get_from_id(string objectId, Amino.Types.Object_Types ty var response = client.ExecutePost(request); if ((int)response.StatusCode != 200) { throw new Exception(response.Content); } if (Debug) { Trace.WriteLine(response.Content); } - return System.Text.Json.JsonSerializer.Deserialize(JsonDocument.Parse(response.Content).RootElement.GetRawText()); + return System.Text.Json.JsonSerializer.Deserialize(JsonDocument.Parse(response.Content).RootElement.GetProperty("linkInfoV2").GetRawText()); } /// diff --git a/Amino.NET/Objects/LastChatMessageSummary.cs b/Amino.NET/Objects/LastChatMessageSummary.cs index 1ac5ae8..d92c380 100644 --- a/Amino.NET/Objects/LastChatMessageSummary.cs +++ b/Amino.NET/Objects/LastChatMessageSummary.cs @@ -6,7 +6,7 @@ public class LastChatMessageSummary { [JsonPropertyName("uid")] public string UserId { get; set; } [JsonPropertyName("isHidden")] public bool? IsHidden { get; set; } - [JsonPropertyName("mediaType")] public string MediaType { get; set; } + [JsonPropertyName("mediaType")] public int? MediaType { get; set; } [JsonPropertyName("content")] public string Content { get; set; } [JsonPropertyName("messageId")] public string MessageId { get; set; } [JsonPropertyName("createdTime")] public string CreatedTime { get; set; } diff --git a/Amino.NET/Objects/WalletInfo.cs b/Amino.NET/Objects/WalletInfo.cs index 7938568..ab5452a 100644 --- a/Amino.NET/Objects/WalletInfo.cs +++ b/Amino.NET/Objects/WalletInfo.cs @@ -10,7 +10,7 @@ public class WalletInfo [JsonPropertyName("adsEnabled")]public bool? AdsEnabled { get; set; } [JsonPropertyName("adsVideoStats")]public string AdsVideoStats { get; set; } [JsonPropertyName("adsFlag")]public string AdsFlag { get; set; } - [JsonPropertyName("totalCoins")]public int? TotalCoins { get; set; } + [JsonPropertyName("totalCoins")]public float? TotalCoins { get; set; } [JsonPropertyName("businessCoinsEnabled")]public bool? BusinessCoinsEnabled { get; set; } [JsonPropertyName("totalBusinessCoins")]public int? TotalBusinessCoins { get; set; } [JsonPropertyName("totalBusinessCoinsFloat")]public float? TotalBusinessCoinsFloat { get; set; } diff --git a/Amino.NET/SubClient.cs b/Amino.NET/SubClient.cs index ce04616..0483337 100644 --- a/Amino.NET/SubClient.cs +++ b/Amino.NET/SubClient.cs @@ -873,7 +873,7 @@ public Task send_activity_time() int optInAdsFlags = 2147483647; int tzf = helpers.TzFilter(); data.Add("userActiveTimeChunkList", timeData); - data.Add("OptInAdsFlags", optInAdsFlags); + data.Add("optInAdsFlags", optInAdsFlags); data.Add("timestamp", (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds); data.Add("timezone", tzf);