Using HTML in a telegram

This is not a duplicate question. I want to use html codes in my telegram written by C #. I searched in SO but I did not find an answer. How to do it? I used TelegramBotSharp. Here is my code related to the part that I explained:

MessageTarget target = (MessageTarget)update.Chat ?? update.From;     
if(Text.StartsWith("Hello")) {
    bot.SendMessage(target, "Hello <a href='http://google.com'> dear</a>", true);
}
+4
source share
1 answer
Use the following syntax in your message:

*bold text*

_italic text_

[inline URL](http://www.example.com/)

[inline mention of a user](tg://user?id=123456789)

pre-formatted fixed-width code block

Note: Only the tags mentioned above are currently supported.

Tags must not be nested.

All <,> and characters that are not part of the tag or HTML object must be replaced with the corresponding HTML objects (< with &lt;, > with &gt; and & with &amp;).

All numeric HTML objects are supported.

Currently, the API only supports the following named HTML objects: &lt;, &gt;, &amp; and &quot;.

+5
source

Source: https://habr.com/ru/post/1695906/


All Articles