Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
298 views
in Technique[技术] by (71.8m points)

c# - Using HTML in Telegram bot

This is not a duplicated question. I want to use html codes in my telegram bot that is written by c#. I searched in SO but I did not find any answer. How to do that? 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);
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
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 & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).

All numerical HTML entities are supported.

The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...