using BotFramework; using BotFramework.Attributes; using BotFramework.Enums; using Kruzya.TelegramBot.Core.Extensions; using Kruzya.TelegramBot.Core.Service; using Newtonsoft.Json; using Telegram.Bot; using Telegram.Bot.Types.Enums; namespace West.TelegramBot.DebugTools; public class Handler : BotEventHandler { private readonly UserService _userService; public Handler(UserService userService) { _userService = userService; } [Command("dump", CommandParseMode.Both)] public async Task HandleDump() { if (!_userService.IsUserSuper(From) && !await Bot.IsUserAdminAsync(Chat, From)) { return; } var message = RawUpdate.Message!; await Bot.SendTextMessageAsync(Chat.Id, $"{JsonConvert.SerializeObject(message.ReplyToMessage, Formatting.Indented)}", replyToMessageId: message.MessageId, parseMode: ParseMode.Html); } }