This library provides some convenience methods to work with Telegram Bot API markup.
Under Telegram.Bot.Extensions.Markup
namespace following static methods are available:
Tools.EscapeMarkdown
- helper method to escape telegram markup symbols.Tools.MentionHtml
- helper method to create a user mention as HTML tag.Tools.MentionMarkdown
- helper method to create a user mention in Markdown syntax.Tools.CreateDeepLinkedUrl
- helper method to create a deep-linked URL.
Under Telegram.Bot.Extensions.Markup.Helpers
namespace following static methods are available:
MessageEntityHelpers.ParseEntities
- mapsMessage.Entities
toMessage.Text
.MessageEntityHelpers.ParseCaptionEntities
- mapsMessage.CaptionEntities
toMessage.Caption
.
Under Telegram.Bot.Extensions.Markup
namespace following Message
extension methods are available:
TextHtml
- creates an HTML-formatted string from the markup entities found in the message.TextHtmlUrled
- creates an HTML-formatted string from the markup entities found in the message.CaptionHtml
- creates an HTML-formatted string from the markup entities found in the message's caption.CaptionHtmlUrled
- creates an HTML-formatted string from the markup entities found in the message's caption.TextMarkdown
- creates a Markdown-formatted string from the markup entities found in the message usingParseMode.Markdown
.TextMarkdownV2
- creates a Markdown-formatted string from the markup entities found in the message usingParseMode.MarkdownV2
.TextMarkdownUrled
- creates a Markdown-formatted string from the markup entities found in the message usingParseMode.Markdown
.TextMarkdownV2Urled
- creates a Markdown-formatted string from the markup entities found in the message usingParseMode.MarkdownV2
.CaptionMarkdown
- creates an Creates a Markdown-formatted string from the markup entities found in the message's caption usingParseMode.Markdown
.CaptionMarkdownV2
- creates an Creates a Markdown-formatted string from the markup entities found in the message's caption usingParseMode.MarkdownV2
.CaptionMarkdownUrled
- creates a Markdown-formatted string from the markup entities found in the message's caption usingParseMode.Markdown
.CaptionMarkdownV2Urled
- creates a Markdown-formatted string from the markup entities found in the message's caption usingParseMode.MarkdownV2
.
Add package to your project with command:
dotnet add package Telegram.Bot.Extensions.Markup
This library is a .NET implementation of python-telegram-bot.
Library use Telegram.Bot for Telegram Bot API specific implementations.
You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL-3. Derivatives works (including modifications or anything statically linked to the library) can only be redistributed under LGPL-3, but applications that use the library don't have to be.