class Telegram::API::MessageEntity
- Telegram::API::MessageEntity
- Telegram::API::Type
- Reference
- Object
Overview
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Defined in:
telegram/api/generated/types.crtelegram/api/overrides/message_entity.cr
Constant Summary
-
MENTION_TYPES =
["mention", "text_mention", "hashtag", "cashtag", "bot_command", "url", "email", "phone_number", "bold", "italic", "code", "pre", "text_link", "underline", "strikethrough", "spoiler"] of ::String
Constructors
- .new(type : String, offset : Int32, length : Int32, url : String | Nil = nil, user : User | Nil = nil, language : String | Nil = nil)
-
.new(pull : JSON::PullParser)
This object represents one special entity in a text message.
Instance Method Summary
- #bold?
- #bot_command?
- #cashtag?
- #code?
- #email?
- #hashtag?
- #italic?
-
#language : String | Nil
Optional.
-
#language=(language : String | Nil)
Optional.
-
#length : Int32
Length of the entity in UTF-16 code units
-
#length=(length : Int32)
Length of the entity in UTF-16 code units
- #mention?
-
#offset : Int32
Offset in UTF-16 code units to the start of the entity
-
#offset=(offset : Int32)
Offset in UTF-16 code units to the start of the entity
- #phone_number?
- #pre?
- #spoiler?
- #strikethrough?
- #text_link?
- #text_mention?
-
#type : String
Type of the entity.
-
#type=(type : String)
Type of the entity.
- #underline?
-
#url : String | Nil
Optional.
-
#url=(url : String | Nil)
Optional.
- #url?
-
#user : User | Nil
Optional.
-
#user=(user : User | Nil)
Optional.
Instance methods inherited from class Telegram::API::Type
==(other)
==,
client
client
Constructor methods inherited from class Telegram::API::Type
new(pull : JSON::PullParser)
new
Constructor Detail
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Instance Method Detail
Optional. For "pre" only, the programming language of the entity text
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)
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)
Optional. For "text_link" only, url that will be opened after user taps on the text
Optional. For "text_link" only, url that will be opened after user taps on the text