class Tourmaline::MessageEntity

Overview

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

Included Modules

Defined in:

tourmaline/types/api.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(type : String, offset : Int32 | Int64, length : Int32 | Int64, url : String | Nil = nil, user : Tourmaline::User | Nil = nil, language : String | Nil = nil, custom_emoji_id : String | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def custom_emoji_id : String | Nil #

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


[View source]
def custom_emoji_id=(custom_emoji_id : String | Nil) #

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


[View source]
def language : String | Nil #

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


[View source]
def language=(language : String | Nil) #

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


[View source]
def length : Int32 | Int64 #

Length of the entity in UTF-16 code units


[View source]
def length=(length : Int32 | Int64) #

Length of the entity in UTF-16 code units


[View source]
def offset : Int32 | Int64 #

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


[View source]
def offset=(offset : Int32 | Int64) #

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


[View source]
def 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" ([email protected]), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "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]
def 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" ([email protected]), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "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]
def url : String | Nil #

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


[View source]
def url=(url : String | Nil) #

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


[View source]
def user : Tourmaline::User | Nil #

Optional. For "text_mention" only, the mentioned user


[View source]
def user=(user : Tourmaline::User | Nil) #

Optional. For "text_mention" only, the mentioned user


[View source]