From 98369e3d926c4a0c13ca9dc0ea22cb4f35bf270b Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:50:15 -0600 Subject: [PATCH] Views can be null --- KfChatDotNetBot/Commands/XeetEmbedCommand.cs | 2 +- KfChatDotNetBot/Models/FxTwitterModels.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Commands/XeetEmbedCommand.cs b/KfChatDotNetBot/Commands/XeetEmbedCommand.cs index cbecdc8..8f0dadd 100644 --- a/KfChatDotNetBot/Commands/XeetEmbedCommand.cs +++ b/KfChatDotNetBot/Commands/XeetEmbedCommand.cs @@ -363,7 +363,7 @@ public class XeetEmbedCommand : ICommand } // Build footer (stats + links) - this will always be on the last message - footerBuilder.Append($"💬 {tweet.Replies:N0} 🔁 {tweet.Retweets:N0} ❤️ {tweet.Likes:N0} 👁️ {tweet.Views:N0}[br]"); + footerBuilder.Append($"💬 {tweet.Replies:N0} 🔁 {tweet.Retweets:N0} ❤️ {tweet.Likes:N0} 👁️ {tweet.Views:N0 ?? 0}[br]"); footerBuilder.Append($"[url={tweet.Url}]X.com[/url] | [url=https://xcancel.com/{tweet.Author.ScreenName}/status/{xeetId}]Xcancel[/url]"); // Split message if needed, with header always first and footer always last diff --git a/KfChatDotNetBot/Models/FxTwitterModels.cs b/KfChatDotNetBot/Models/FxTwitterModels.cs index 34d5cdf..1f9a83e 100644 --- a/KfChatDotNetBot/Models/FxTwitterModels.cs +++ b/KfChatDotNetBot/Models/FxTwitterModels.cs @@ -23,7 +23,7 @@ internal class FxTweet [JsonPropertyName("created_timestamp")] public long CreatedTimestamp { get; set; } - [JsonPropertyName("views")] public int Views { get; set; } + [JsonPropertyName("views")] public int? Views { get; set; } [JsonPropertyName("is_note_tweet")] public bool IsNoteTweet { get; set; } [JsonPropertyName("community_note")] public object? CommunityNote { get; set; } [JsonPropertyName("lang")] public string Lang { get; set; } = string.Empty;