fix(debug_tools): /dump json encoding & field naming

This commit is contained in:
West
2025-05-19 13:25:06 +03:00
parent 2a68657e01
commit 690da74459
+8 -3
View File
@@ -1,18 +1,23 @@
using BotFramework; using System.Text.Encodings.Web;
using BotFramework;
using BotFramework.Attributes; using BotFramework.Attributes;
using BotFramework.Enums; using BotFramework.Enums;
using BotFramework.Utils; using BotFramework.Utils;
using Kruzya.TelegramBot.Core.Extensions; using Kruzya.TelegramBot.Core.Extensions;
using Kruzya.TelegramBot.Core.Service; using Kruzya.TelegramBot.Core.Service;
using System.Text.Json; using System.Text.Json;
using Telegram.Bot;
namespace West.TelegramBot.DebugTools; namespace West.TelegramBot.DebugTools;
public class Handler : BotEventHandler public class Handler : BotEventHandler
{ {
private readonly UserService _userService; private readonly UserService _userService;
private static readonly JsonSerializerOptions DumpOptions = new() { WriteIndented = true }; private static readonly JsonSerializerOptions DumpOptions = new(JsonBotAPI.Options)
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
public Handler(UserService userService) public Handler(UserService userService)
{ {