Show / Hide Table of Contents

Class FormattedTextExtraction

Custom extension class, implements methods to extract HTML- or Markdown-formatted text from messages, using their message entities

Inheritance
System.Object
FormattedTextExtraction
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TelegramBotApi.Extensions.FormattedTextExtraction
Assembly: TelegramBotApi.dll
Syntax
public static class FormattedTextExtraction

Methods

| Improve this Doc View Source

ExtractHTML(String, MessageEntity[])

Extracts the HTML-formatted text from a message text, using the message's entities. Calling this method will not result in an API call.

Declaration
public static string ExtractHTML(this string messageText, MessageEntity[] messageEntities)
Parameters
Type Name Description
System.String messageText

The message text to be HTML-formatted

MessageEntity[] messageEntities

The entities of the message, with which the messageText is formatted

Returns
Type Description
System.String

The messageText, HTML-formatted with the given messageEntities

| Improve this Doc View Source

ExtractHTML(Message)

Extracts the HTML-formatted text from a message, using its message entities. Calling this method will not result in an API call.

Declaration
public static string ExtractHTML(this Message message)
Parameters
Type Name Description
Message message

The message to extract the HTML-formatted text

Returns
Type Description
System.String

HTML-formatted text of the given message

| Improve this Doc View Source

ExtractMarkdown(String, MessageEntity[])

Extracts the Markdown-formatted text from a message text, using the message's entities. Calling this method will not result in an API call.

Declaration
public static string ExtractMarkdown(this string messageText, MessageEntity[] messageEntities)
Parameters
Type Name Description
System.String messageText

The message text to be Markdown-formatted

MessageEntity[] messageEntities

The entities of the message, with which the messageText is formatted

Returns
Type Description
System.String

The messageText, Markdown-formatted with the given messageEntities

| Improve this Doc View Source

ExtractMarkdown(Message)

Extracts the Markdown-formatted text from a message, using its message entities. Calling this method will not result in an API call.

Declaration
public static string ExtractMarkdown(this Message message)
Parameters
Type Name Description
Message message

The message to extract the Markdown-formatted text

Returns
Type Description
System.String

Markdown-formatted text of the given message

  • Improve this Doc
  • View Source
Back to top Generated by DocFX