Skip to content

class Tourmaline::MessageEntity
inherits Reference #

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Included modules

JSON::Serializable

Constructors#

.new(type, offset, length, url : String? = nil, user : Tourmaline::User? = nil, language : String? = nil, custom_emoji_id : String? = nil) #

View source

.new(pull : JSON::PullParser) #

View source

Methods#

#custom_emoji_id : String? #

Optional. For "custom_emoji" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker

View source

#custom_emoji_id=(custom_emoji_id : String?) #

Optional. For "custom_emoji" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker

View source

#language : String? #

Optional. For "pre" only, the programming language of the entity text

View source

#language=(language : String?) #

Optional. For "pre" only, the programming language of the entity text

View source

#length : Int32 | Int64 #

Length of the entity in UTF-16 code units

View source

#length=(length : Int32 | Int64) #

Length of the entity in UTF-16 code units

View source

#offset : Int32 | Int64 #

Offset in UTF-16 code units to the start of the entity

View source

#offset=(offset : Int32 | Int64) #

Offset in UTF-16 code units to the start of the entity

View source

#type : String #

Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "blockquote" (block quotation), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames), "custom_emoji" (for inline custom emoji stickers)

View source

#type=(type : String) #

Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "blockquote" (block quotation), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames), "custom_emoji" (for inline custom emoji stickers)

View source

#url : String? #

Optional. For "text_link" only, URL that will be opened after user taps on the text

View source

#url=(url : String?) #

Optional. For "text_link" only, URL that will be opened after user taps on the text

View source

#user : Tourmaline::User? #

Optional. For "text_mention" only, the mentioned user

View source

#user=(user : Tourmaline::User?) #

Optional. For "text_mention" only, the mentioned user

View source