mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
feat(debug-tools): syntax highlighting, ability to call without reply
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
using BotFramework;
|
||||
using BotFramework.Attributes;
|
||||
using BotFramework.Enums;
|
||||
using BotFramework.Utils;
|
||||
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;
|
||||
|
||||
@@ -25,10 +24,10 @@ public class Handler : BotEventHandler
|
||||
{
|
||||
return;
|
||||
}
|
||||
var message = RawUpdate.Message!.ReplyToMessage ?? RawUpdate.Message;
|
||||
var text = HtmlString.Empty
|
||||
.CodeWithStyle("language-json", JsonConvert.SerializeObject(message, Formatting.Indented));
|
||||
|
||||
var message = RawUpdate.Message!;
|
||||
await Bot.SendTextMessageAsync(Chat.Id,
|
||||
$"<code>{JsonConvert.SerializeObject(message.ReplyToMessage, Formatting.Indented)}</code>",
|
||||
replyToMessageId: message.MessageId, parseMode: ParseMode.Html);
|
||||
await Bot.SendHtmlStringAsync(Chat, text, replyTo: message.MessageId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user