class Hamilton::Types::MessageEntity

Overview

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

Included Modules

Defined in:

types/message_entity.cr

Constructors

Instance Method Summary

Instance methods inherited from class Reference

==(other : Hamilton::Any) ==

Instance methods inherited from class Object

===(other : Hamilton::Any) ===

Constructor Detail

def self.new(pull : JSON::PullParser) #

def self.new(params) #

def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

def self.new(**params) #

Instance Method Detail

def custom_emoji_id : String | Nil #

For “custom_emoji” only, unique identifier of the custom emoji.


def custom_emoji_id=(custom_emoji_id : String | Nil) #

For “custom_emoji” only, unique identifier of the custom emoji.


def language : String | Nil #

For “pre” only, the programming language of the entity text.


def language=(language : String | Nil) #

For “pre” only, the programming language of the entity text.


def length : Int32 #

Length of the entity in UTF-16 code units.


def length=(length : Int32) #

Length of the entity in UTF-16 code units.


def non_nil_fields : Array(String) #

List of available non-nil fields.


def non_nil_fields=(non_nil_fields : Array(String)) #

List of available non-nil fields.


def offset : Int32 #

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


def offset=(offset : Int32) #

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


def type : String #

Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “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), “expandable_blockquote” (collapsed-by-default 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)


def type=(type : String) #

Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “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), “expandable_blockquote” (collapsed-by-default 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)


def url : String | Nil #

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


def url=(url : String | Nil) #

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


def user : Hamilton::Types::User | Nil #

For “text_mention” only, the mentioned user.


def user=(user : Hamilton::Types::User | Nil) #

For “text_mention” only, the mentioned user.