From 6240f7c7f19ed2320c1f525dd07a9a9d011e0462 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Wed, 18 Mar 2026 23:53:45 -0500 Subject: [PATCH] Ignore some null warnings and fix compiler errors related to the shop --- KfChatDotNetBot/Services/KasinoShop.cs | 6 ++++-- KfChatDotNetWsClient/ChatClient.cs | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/KfChatDotNetBot/Services/KasinoShop.cs b/KfChatDotNetBot/Services/KasinoShop.cs index d068ca3..5667778 100644 --- a/KfChatDotNetBot/Services/KasinoShop.cs +++ b/KfChatDotNetBot/Services/KasinoShop.cs @@ -245,7 +245,8 @@ public class KasinoShop { int cc = Gambler_Profiles[gambler.User.KfId].CrackCounter; List drugs = new(); - drugs.Add($"1. Crack: {await (CrackPrice * cc).FormatKasinoCurrencyAsync()} per dose"); + var crackPrice = CrackPrice * cc; + drugs.Add($"1. Crack: {await crackPrice.FormatKasinoCurrencyAsync()} per dose"); drugs.Add($"2. Weed: {await WeedPricePerHour.FormatKasinoCurrencyAsync()} per hour"); if (Gambler_Profiles[gambler.User.KfId].FloorNugs > 0) { @@ -1140,7 +1141,8 @@ public class KasinoShop } public async Task FormatBalanceAsync() { - string str = OutstandingLoanBalance > 0 ? $"| Net Balance: {await (CryptoBalance-OutstandingLoanBalance).FormatKasinoCurrencyAsync()}":""; + var netBalance = CryptoBalance - OutstandingLoanBalance; + string str = OutstandingLoanBalance > 0 ? $"| Net Balance: {await netBalance.FormatKasinoCurrencyAsync()}":""; return $"Balance: {await CryptoBalance.FormatKasinoCurrencyAsync()}{str}"; } public decimal[] Balance() diff --git a/KfChatDotNetWsClient/ChatClient.cs b/KfChatDotNetWsClient/ChatClient.cs index 386a5a4..006d240 100644 --- a/KfChatDotNetWsClient/ChatClient.cs +++ b/KfChatDotNetWsClient/ChatClient.cs @@ -418,13 +418,13 @@ public class ChatClient private void WsWhisper(ResponseMessage message) { - var data = JsonSerializer.Deserialize(message.Text).GetProperty("whisper") + var data = JsonSerializer.Deserialize(message.Text!).GetProperty("whisper") .Deserialize(); var model = new WhisperModel { Author = new UserModel { - Id = data.Author.Id, + Id = data!.Author.Id, Username = data.Author.Username, AvatarUrl = data.Author.AvatarUrl }, @@ -452,14 +452,14 @@ public class ChatClient private void WsMotd(ResponseMessage message) { - var msg = JsonSerializer.Deserialize(message.Text).GetProperty("motd") + var msg = JsonSerializer.Deserialize(message.Text!).GetProperty("motd") .Deserialize(); var model = new MessageModel { Author = new UserModel { - Id = msg.Author.Id, + Id = msg!.Author.Id, Username = msg.Author.Username, AvatarUrl = msg.Author.AvatarUrl, // It isn't sent on chat messages