In my Telegram Bot I need to show HTML formatted view in my inline query:
private static async void BotOnInlineQueryReceived(
object sender,
InlineQueryEventArgs inlineQueryEventArgs)
{
Console.WriteLine(
$"Received inline query from: {inlineQueryEventArgs.InlineQuery.From.Id}");
InlineQueryResultBase[] results = {
new InlineQueryResultArticle(
id: "1",
title : "<b>Test</b>",
inputMessageContent : new InputTextMessageContent("<b>Test</b>"))
};
await Bot.AnswerInlineQueryAsync(
inlineQueryEventArgs.InlineQuery.Id,
results,
isPersonal: true,
cacheTime: 0
);
}
I tried this code but I got this result:
I need an output like this:
2
Answers
I found the solution:
and the result as below:
If you can use
SendTextMessageAsync
then you could specify the parse mode parameter to use either markdown or HTML, here is an example using HTML:More info here: https://core.telegram.org/bots/api#sendmessage