From 690da74459400f12b05990c2980dc0e1a8647dfd Mon Sep 17 00:00:00 2001 From: West <30056636+West14@users.noreply.github.com> Date: Mon, 19 May 2025 13:25:06 +0300 Subject: [PATCH] fix(debug_tools): /dump json encoding & field naming --- modules/DebugTools/Handler.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/DebugTools/Handler.cs b/modules/DebugTools/Handler.cs index d803611..b1080b5 100644 --- a/modules/DebugTools/Handler.cs +++ b/modules/DebugTools/Handler.cs @@ -1,18 +1,23 @@ -using BotFramework; +using System.Text.Encodings.Web; +using BotFramework; using BotFramework.Attributes; using BotFramework.Enums; using BotFramework.Utils; using Kruzya.TelegramBot.Core.Extensions; using Kruzya.TelegramBot.Core.Service; using System.Text.Json; +using Telegram.Bot; namespace West.TelegramBot.DebugTools; public class Handler : BotEventHandler { 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) {