fix: build and lots of obsolete warnings

This commit is contained in:
Andriy
2025-02-09 17:40:03 +02:00
parent 8917a8ba5f
commit c3a553f68d
29 changed files with 103 additions and 108 deletions
+4 -2
View File
@@ -4,13 +4,15 @@ using BotFramework.Enums;
using BotFramework.Utils;
using Kruzya.TelegramBot.Core.Extensions;
using Kruzya.TelegramBot.Core.Service;
using Newtonsoft.Json;
using System.Text.Json;
namespace West.TelegramBot.DebugTools;
public class Handler : BotEventHandler
{
private readonly UserService _userService;
private static readonly JsonSerializerOptions DumpOptions = new() { WriteIndented = true };
public Handler(UserService userService)
{
@@ -26,7 +28,7 @@ public class Handler : BotEventHandler
}
var message = RawUpdate.Message!.ReplyToMessage ?? RawUpdate.Message;
var text = HtmlString.Empty
.CodeWithStyle("language-json", JsonConvert.SerializeObject(message, Formatting.Indented));
.CodeWithStyle("language-json", JsonSerializer.Serialize(message, DumpOptions));
await Bot.SendHtmlStringAsync(Chat, text, replyTo: message.MessageId);
}