Skip to content

class Tourmaline::Message
inherits Reference #

This object represents a message.

Included modules

JSON::Serializable

Constructors#

View source

.new(pull : JSON::PullParser) #

View source

Methods#

#animation : Tourmaline::Animation? #

Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

View source

#animation=(animation : Tourmaline::Animation?) #

Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

View source

#audio : Tourmaline::Audio? #

Optional. Message is an audio file, information about the file

View source

#audio=(audio : Tourmaline::Audio?) #

Optional. Message is an audio file, information about the file

View source

#author_signature : String? #

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

View source

#author_signature=(author_signature : String?) #

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

View source

#caption : String? #

Optional. Caption for the animation, audio, document, photo, video or voice

View source

#caption=(caption : String?) #

Optional. Caption for the animation, audio, document, photo, video or voice

View source

#caption_entities : Array(Tourmaline::MessageEntity) #

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

View source

#caption_entities=(caption_entities : Array(Tourmaline::MessageEntity)) #

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

View source

#channel_chat_created=(channel_chat_created : Bool?) #

Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

View source

#channel_chat_created? : Bool? #

Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

View source

#chat : Tourmaline::Chat #

Chat the message belongs to

View source

#chat=(chat : Tourmaline::Chat) #

Chat the message belongs to

View source

#chat_shared : Tourmaline::ChatShared? #

Optional. Service message: a chat was shared with the bot

View source

#chat_shared=(chat_shared : Tourmaline::ChatShared?) #

Optional. Service message: a chat was shared with the bot

View source

#chats(&block : Chat -> ) #

View source

#chats #

View source

#connected_website : String? #

Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login

View source

#connected_website=(connected_website : String?) #

Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login

View source

#contact : Tourmaline::Contact? #

Optional. Message is a shared contact, information about the contact

View source

#contact=(contact : Tourmaline::Contact?) #

Optional. Message is a shared contact, information about the contact

View source

#date : Time #

View source

#date=(date : Time) #

View source

#delete_chat_photo=(delete_chat_photo : Bool?) #

Optional. Service message: the chat photo was deleted

View source

#delete_chat_photo? : Bool? #

Optional. Service message: the chat photo was deleted

View source

#dice : Tourmaline::Dice? #

Optional. Message is a dice with random value

View source

#dice=(dice : Tourmaline::Dice?) #

Optional. Message is a dice with random value

View source

#document : Tourmaline::Document? #

Optional. Message is a general file, information about the file

View source

#document=(document : Tourmaline::Document?) #

Optional. Message is a general file, information about the file

View source

#edit_date : Time? #

View source

#edit_date=(edit_date : Time?) #

View source

#entities : Array(Tourmaline::MessageEntity) #

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

View source

#entities=(entities : Array(Tourmaline::MessageEntity)) #

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

View source

#external_reply : Tourmaline::ExternalReplyInfo? #

Optional. Information about the message that is being replied to, which may come from another chat or forum topic

View source

#external_reply=(external_reply : Tourmaline::ExternalReplyInfo?) #

Optional. Information about the message that is being replied to, which may come from another chat or forum topic

View source

#file #

View source

#forum_topic_closed : Tourmaline::ForumTopicClosed? #

Optional. Service message: forum topic closed

View source

#forum_topic_closed=(forum_topic_closed : Tourmaline::ForumTopicClosed?) #

Optional. Service message: forum topic closed

View source

#forum_topic_created : Tourmaline::ForumTopicCreated? #

Optional. Service message: forum topic created

View source

#forum_topic_created=(forum_topic_created : Tourmaline::ForumTopicCreated?) #

Optional. Service message: forum topic created

View source

#forum_topic_edited : Tourmaline::ForumTopicEdited? #

Optional. Service message: forum topic edited

View source

#forum_topic_edited=(forum_topic_edited : Tourmaline::ForumTopicEdited?) #

Optional. Service message: forum topic edited

View source

#forum_topic_reopened : Tourmaline::ForumTopicReopened? #

Optional. Service message: forum topic reopened

View source

#forum_topic_reopened=(forum_topic_reopened : Tourmaline::ForumTopicReopened?) #

Optional. Service message: forum topic reopened

View source

#forward_origin : Tourmaline::MessageOrigin? #

Optional. Information about the original message for forwarded messages

View source

#forward_origin=(forward_origin : Tourmaline::MessageOrigin?) #

Optional. Information about the original message for forwarded messages

View source

#from : Tourmaline::User? #

Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

View source

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

Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

View source

#game : Tourmaline::Game? #

Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games

View source

#game=(game : Tourmaline::Game?) #

Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games

View source

#general_forum_topic_hidden : Tourmaline::GeneralForumTopicHidden? #

Optional. Service message: the 'General' forum topic hidden

View source

#general_forum_topic_hidden=(general_forum_topic_hidden : Tourmaline::GeneralForumTopicHidden?) #

Optional. Service message: the 'General' forum topic hidden

View source

#general_forum_topic_unhidden : Tourmaline::GeneralForumTopicUnhidden? #

Optional. Service message: the 'General' forum topic unhidden

View source

#general_forum_topic_unhidden=(general_forum_topic_unhidden : Tourmaline::GeneralForumTopicUnhidden?) #

Optional. Service message: the 'General' forum topic unhidden

View source

#giveaway : Tourmaline::Giveaway? #

Optional. The message is a scheduled giveaway message

View source

#giveaway=(giveaway : Tourmaline::Giveaway?) #

Optional. The message is a scheduled giveaway message

View source

#giveaway_completed : Tourmaline::GiveawayCompleted? #

Optional. Service message: a giveaway without public winners was completed

View source

#giveaway_completed=(giveaway_completed : Tourmaline::GiveawayCompleted?) #

Optional. Service message: a giveaway without public winners was completed

View source

#giveaway_created : Tourmaline::GiveawayCreated? #

Optional. Service message: a scheduled giveaway was created

View source

#giveaway_created=(giveaway_created : Tourmaline::GiveawayCreated?) #

Optional. Service message: a scheduled giveaway was created

View source

#giveaway_winners : Tourmaline::GiveawayWinners? #

Optional. A giveaway with public winners was completed

View source

#giveaway_winners=(giveaway_winners : Tourmaline::GiveawayWinners?) #

Optional. A giveaway with public winners was completed

View source

#group_chat_created=(group_chat_created : Bool?) #

Optional. Service message: the group has been created

View source

#group_chat_created? : Bool? #

Optional. Service message: the group has been created

View source

#has_media_spoiler=(has_media_spoiler : Bool?) #

Optional. True, if the message media is covered by a spoiler animation

View source

#has_media_spoiler? : Bool? #

Optional. True, if the message media is covered by a spoiler animation

View source

#has_protected_content=(has_protected_content : Bool?) #

Optional. True, if the message can't be forwarded

View source

#has_protected_content? : Bool? #

Optional. True, if the message can't be forwarded

View source

#invoice : Tourmaline::Invoice? #

Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments

View source

#invoice=(invoice : Tourmaline::Invoice?) #

Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments

View source

#is_automatic_forward=(is_automatic_forward : Bool?) #

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group

View source

#is_automatic_forward? : Bool? #

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group

View source

#is_topic_message=(is_topic_message : Bool?) #

Optional. True, if the message is sent to a forum topic

View source

#is_topic_message? : Bool? #

Optional. True, if the message is sent to a forum topic

View source

#left_chat_member : Tourmaline::User? #

Optional. A member was removed from the group, information about them (this member may be the bot itself)

View source

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

Optional. A member was removed from the group, information about them (this member may be the bot itself)

View source
View source

Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed

View source

Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed

View source

#location : Tourmaline::Location? #

Optional. Message is a shared location, information about the location

View source

#location=(location : Tourmaline::Location?) #

Optional. Message is a shared location, information about the location

View source

#media_group_id : String? #

Optional. The unique identifier of a media message group this message belongs to

View source

#media_group_id=(media_group_id : String?) #

Optional. The unique identifier of a media message group this message belongs to

View source

#message_auto_delete_timer_changed : Tourmaline::MessageAutoDeleteTimerChanged? #

Optional. Service message: auto-delete timer settings changed in the chat

View source

#message_auto_delete_timer_changed=(message_auto_delete_timer_changed : Tourmaline::MessageAutoDeleteTimerChanged?) #

Optional. Service message: auto-delete timer settings changed in the chat

View source

#message_id : Int32 | Int64 #

Unique message identifier inside this chat

View source

#message_id=(message_id : Int32 | Int64) #

Unique message identifier inside this chat

View source

#message_thread_id : Int32 | Int64 | Nil #

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

View source

#message_thread_id=(message_thread_id : Int32 | Int64 | Nil) #

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

View source

#migrate_from_chat_id : Int32 | Int64 | Nil #

Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

View source

#migrate_from_chat_id=(migrate_from_chat_id : Int32 | Int64 | Nil) #

Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

View source

#migrate_to_chat_id : Int32 | Int64 | Nil #

Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

View source

#migrate_to_chat_id=(migrate_to_chat_id : Int32 | Int64 | Nil) #

Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

View source

#new_chat_members : Array(Tourmaline::User) #

Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

View source

#new_chat_members=(new_chat_members : Array(Tourmaline::User)) #

Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

View source

#new_chat_photo : Array(Tourmaline::PhotoSize) #

Optional. A chat photo was change to this value

View source

#new_chat_photo=(new_chat_photo : Array(Tourmaline::PhotoSize)) #

Optional. A chat photo was change to this value

View source

#new_chat_title : String? #

Optional. A chat title was changed to this value

View source

#new_chat_title=(new_chat_title : String?) #

Optional. A chat title was changed to this value

View source

#passport_data : Tourmaline::PassportData? #

Optional. Telegram Passport data

View source

#passport_data=(passport_data : Tourmaline::PassportData?) #

Optional. Telegram Passport data

View source

#photo : Array(Tourmaline::PhotoSize) #

Optional. Message is a photo, available sizes of the photo

View source

#photo=(photo : Array(Tourmaline::PhotoSize)) #

Optional. Message is a photo, available sizes of the photo

View source

#pinned_message : Tourmaline::MaybeInaccessibleMessage? #

Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

View source

#pinned_message=(pinned_message : Tourmaline::MaybeInaccessibleMessage?) #

Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

View source

#poll : Tourmaline::Poll? #

Optional. Message is a native poll, information about the poll

View source

#poll=(poll : Tourmaline::Poll?) #

Optional. Message is a native poll, information about the poll

View source

#proximity_alert_triggered : Tourmaline::ProximityAlertTriggered? #

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

View source

#proximity_alert_triggered=(proximity_alert_triggered : Tourmaline::ProximityAlertTriggered?) #

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

View source

#quote : Tourmaline::TextQuote? #

Optional. For replies that quote part of the original message, the quoted part of the message

View source

#quote=(quote : Tourmaline::TextQuote?) #

Optional. For replies that quote part of the original message, the quoted part of the message

View source

#reply_markup : Tourmaline::InlineKeyboardMarkup? #

Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

View source

#reply_markup=(reply_markup : Tourmaline::InlineKeyboardMarkup?) #

Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

View source

#reply_to_message : Tourmaline::Message? #

Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

View source

#reply_to_message=(reply_to_message : Tourmaline::Message?) #

Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

View source

#sender_chat : Tourmaline::Chat? #

Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

View source

#sender_chat=(sender_chat : Tourmaline::Chat?) #

Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

View source

#sender_type #

View source

#sticker : Tourmaline::Sticker? #

Optional. Message is a sticker, information about the sticker

View source

#sticker=(sticker : Tourmaline::Sticker?) #

Optional. Message is a sticker, information about the sticker

View source

#story : Tourmaline::Story? #

Optional. Message is a forwarded story

View source

#story=(story : Tourmaline::Story?) #

Optional. Message is a forwarded story

View source

#successful_payment : Tourmaline::SuccessfulPayment? #

Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments

View source

#successful_payment=(successful_payment : Tourmaline::SuccessfulPayment?) #

Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments

View source

#supergroup_chat_created=(supergroup_chat_created : Bool?) #

Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

View source

#supergroup_chat_created? : Bool? #

Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

View source

#text : String? #

Optional. For text messages, the actual UTF-8 text of the message

View source

#text=(text : String?) #

Optional. For text messages, the actual UTF-8 text of the message

View source

#text_entities(type : String) #

View source

#text_entities #

View source

#users(&block : User -> ) #

View source

#users #

View source

#users_shared : Tourmaline::UsersShared? #

Optional. Service message: users were shared with the bot

View source

#users_shared=(users_shared : Tourmaline::UsersShared?) #

Optional. Service message: users were shared with the bot

View source

#venue : Tourmaline::Venue? #

Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

View source

#venue=(venue : Tourmaline::Venue?) #

Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

View source

#via_bot : Tourmaline::User? #

Optional. Bot through which the message was sent

View source

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

Optional. Bot through which the message was sent

View source

#video : Tourmaline::Video? #

Optional. Message is a video, information about the video

View source

#video=(video : Tourmaline::Video?) #

Optional. Message is a video, information about the video

View source

#video_chat_ended : Tourmaline::VideoChatEnded? #

Optional. Service message: video chat ended

View source

#video_chat_ended=(video_chat_ended : Tourmaline::VideoChatEnded?) #

Optional. Service message: video chat ended

View source

#video_chat_participants_invited : Tourmaline::VideoChatParticipantsInvited? #

Optional. Service message: new participants invited to a video chat

View source

#video_chat_participants_invited=(video_chat_participants_invited : Tourmaline::VideoChatParticipantsInvited?) #

Optional. Service message: new participants invited to a video chat

View source

#video_chat_scheduled : Tourmaline::VideoChatScheduled? #

Optional. Service message: video chat scheduled

View source

#video_chat_scheduled=(video_chat_scheduled : Tourmaline::VideoChatScheduled?) #

Optional. Service message: video chat scheduled

View source

#video_chat_started : Tourmaline::VideoChatStarted? #

Optional. Service message: video chat started

View source

#video_chat_started=(video_chat_started : Tourmaline::VideoChatStarted?) #

Optional. Service message: video chat started

View source

#video_note : Tourmaline::VideoNote? #

Optional. Message is a video note, information about the video message

View source

#video_note=(video_note : Tourmaline::VideoNote?) #

Optional. Message is a video note, information about the video message

View source

#voice : Tourmaline::Voice? #

Optional. Message is a voice message, information about the file

View source

#voice=(voice : Tourmaline::Voice?) #

Optional. Message is a voice message, information about the file

View source

#web_app_data : Tourmaline::WebAppData? #

Optional. Service message: data sent by a Web App

View source

#web_app_data=(web_app_data : Tourmaline::WebAppData?) #

Optional. Service message: data sent by a Web App

View source

#write_access_allowed : Tourmaline::WriteAccessAllowed? #

Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess

View source

#write_access_allowed=(write_access_allowed : Tourmaline::WriteAccessAllowed?) #

Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess

View source