class Tourmaline::Message
- Tourmaline::Message
- Reference
- Object
Overview
This object represents a message.
Included Modules
- JSON::Serializable
Defined in:
tourmaline/types/api.crtourmaline/types/custom/message.cr
Constructors
- .new(message_id : Int32 | Int64, date : Time, chat : Tourmaline::Chat, message_thread_id : Int32 | Int64 | Nil = nil, from : Tourmaline::User | Nil = nil, sender_chat : Tourmaline::Chat | Nil = nil, forward_from : Tourmaline::User | Nil = nil, forward_from_chat : Tourmaline::Chat | Nil = nil, forward_from_message_id : Int32 | Int64 | Nil = nil, forward_signature : String | Nil = nil, forward_sender_name : String | Nil = nil, forward_date : Int32 | Int64 | Nil = nil, is_topic_message : Bool | Nil = nil, is_automatic_forward : Bool | Nil = nil, reply_to_message : Tourmaline::Message | Nil = nil, via_bot : Tourmaline::User | Nil = nil, edit_date : Int32 | Int64 | Nil = nil, has_protected_content : Bool | Nil = nil, media_group_id : String | Nil = nil, author_signature : String | Nil = nil, text : String | Nil = nil, entities : Array(Tourmaline::MessageEntity) = [] of Tourmaline::MessageEntity, animation : Tourmaline::Animation | Nil = nil, audio : Tourmaline::Audio | Nil = nil, document : Tourmaline::Document | Nil = nil, photo : Array(Tourmaline::PhotoSize) = [] of Tourmaline::PhotoSize, sticker : Tourmaline::Sticker | Nil = nil, video : Tourmaline::Video | Nil = nil, video_note : Tourmaline::VideoNote | Nil = nil, voice : Tourmaline::Voice | Nil = nil, caption : String | Nil = nil, caption_entities : Array(Tourmaline::MessageEntity) = [] of Tourmaline::MessageEntity, has_media_spoiler : Bool | Nil = nil, contact : Tourmaline::Contact | Nil = nil, dice : Tourmaline::Dice | Nil = nil, game : Tourmaline::Game | Nil = nil, poll : Tourmaline::Poll | Nil = nil, venue : Tourmaline::Venue | Nil = nil, location : Tourmaline::Location | Nil = nil, new_chat_members : Array(Tourmaline::User) = [] of Tourmaline::User, left_chat_member : Tourmaline::User | Nil = nil, new_chat_title : String | Nil = nil, new_chat_photo : Array(Tourmaline::PhotoSize) = [] of Tourmaline::PhotoSize, delete_chat_photo : Bool | Nil = nil, group_chat_created : Bool | Nil = nil, supergroup_chat_created : Bool | Nil = nil, channel_chat_created : Bool | Nil = nil, message_auto_delete_timer_changed : Tourmaline::MessageAutoDeleteTimerChanged | Nil = nil, migrate_to_chat_id : Int32 | Int64 | Nil = nil, migrate_from_chat_id : Int32 | Int64 | Nil = nil, pinned_message : Tourmaline::Message | Nil = nil, invoice : Tourmaline::Invoice | Nil = nil, successful_payment : Tourmaline::SuccessfulPayment | Nil = nil, user_shared : Tourmaline::UserShared | Nil = nil, chat_shared : Tourmaline::ChatShared | Nil = nil, connected_website : String | Nil = nil, write_access_allowed : Tourmaline::WriteAccessAllowed | Nil = nil, passport_data : Tourmaline::PassportData | Nil = nil, proximity_alert_triggered : Tourmaline::ProximityAlertTriggered | Nil = nil, forum_topic_created : Tourmaline::ForumTopicCreated | Nil = nil, forum_topic_edited : Tourmaline::ForumTopicEdited | Nil = nil, forum_topic_closed : Tourmaline::ForumTopicClosed | Nil = nil, forum_topic_reopened : Tourmaline::ForumTopicReopened | Nil = nil, general_forum_topic_hidden : Tourmaline::GeneralForumTopicHidden | Nil = nil, general_forum_topic_unhidden : Tourmaline::GeneralForumTopicUnhidden | Nil = nil, video_chat_scheduled : Tourmaline::VideoChatScheduled | Nil = nil, video_chat_started : Tourmaline::VideoChatStarted | Nil = nil, video_chat_ended : Tourmaline::VideoChatEnded | Nil = nil, video_chat_participants_invited : Tourmaline::VideoChatParticipantsInvited | Nil = nil, web_app_data : Tourmaline::WebAppData | Nil = nil, reply_markup : Tourmaline::InlineKeyboardMarkup | Nil = nil)
- .new(pull : JSON::PullParser)
Instance Method Summary
-
#animation : Tourmaline::Animation | Nil
Optional.
-
#animation=(animation : Tourmaline::Animation | Nil)
Optional.
-
#audio : Tourmaline::Audio | Nil
Optional.
-
#audio=(audio : Tourmaline::Audio | Nil)
Optional.
-
#author_signature : String | Nil
Optional.
-
#author_signature=(author_signature : String | Nil)
Optional.
-
#caption : String | Nil
Optional.
-
#caption=(caption : String | Nil)
Optional.
-
#caption_entities : Array(Tourmaline::MessageEntity)
Optional.
-
#caption_entities=(caption_entities : Array(Tourmaline::MessageEntity))
Optional.
-
#channel_chat_created=(channel_chat_created : Bool | Nil)
Optional.
-
#channel_chat_created? : Bool | Nil
Optional.
-
#chat : Tourmaline::Chat
Conversation the message belongs to
-
#chat=(chat : Tourmaline::Chat)
Conversation the message belongs to
-
#chat_shared : Tourmaline::ChatShared | Nil
Optional.
-
#chat_shared=(chat_shared : Tourmaline::ChatShared | Nil)
Optional.
- #chats
- #chats(&block : Chat -> )
-
#connected_website : String | Nil
Optional.
-
#connected_website=(connected_website : String | Nil)
Optional.
-
#contact : Tourmaline::Contact | Nil
Optional.
-
#contact=(contact : Tourmaline::Contact | Nil)
Optional.
- #date : Time
- #date=(date : Time)
-
#delete_chat_photo=(delete_chat_photo : Bool | Nil)
Optional.
-
#delete_chat_photo? : Bool | Nil
Optional.
-
#dice : Tourmaline::Dice | Nil
Optional.
-
#dice=(dice : Tourmaline::Dice | Nil)
Optional.
-
#document : Tourmaline::Document | Nil
Optional.
-
#document=(document : Tourmaline::Document | Nil)
Optional.
- #edit_date : Time | Nil
- #edit_date=(edit_date : Time | Nil)
-
#entities : Array(Tourmaline::MessageEntity)
Optional.
-
#entities=(entities : Array(Tourmaline::MessageEntity))
Optional.
- #file
-
#forum_topic_closed : Tourmaline::ForumTopicClosed | Nil
Optional.
-
#forum_topic_closed=(forum_topic_closed : Tourmaline::ForumTopicClosed | Nil)
Optional.
-
#forum_topic_created : Tourmaline::ForumTopicCreated | Nil
Optional.
-
#forum_topic_created=(forum_topic_created : Tourmaline::ForumTopicCreated | Nil)
Optional.
-
#forum_topic_edited : Tourmaline::ForumTopicEdited | Nil
Optional.
-
#forum_topic_edited=(forum_topic_edited : Tourmaline::ForumTopicEdited | Nil)
Optional.
-
#forum_topic_reopened : Tourmaline::ForumTopicReopened | Nil
Optional.
-
#forum_topic_reopened=(forum_topic_reopened : Tourmaline::ForumTopicReopened | Nil)
Optional.
- #forward_date : Time | Nil
- #forward_date=(forward_date : Time | Nil)
-
#forward_from : Tourmaline::User | Nil
Optional.
-
#forward_from=(forward_from : Tourmaline::User | Nil)
Optional.
-
#forward_from_chat : Tourmaline::Chat | Nil
Optional.
-
#forward_from_chat=(forward_from_chat : Tourmaline::Chat | Nil)
Optional.
-
#forward_from_message_id : Int32 | Int64 | Nil
Optional.
-
#forward_from_message_id=(forward_from_message_id : Int32 | Int64 | Nil)
Optional.
-
#forward_sender_name : String | Nil
Optional.
-
#forward_sender_name=(forward_sender_name : String | Nil)
Optional.
-
#forward_signature : String | Nil
Optional.
-
#forward_signature=(forward_signature : String | Nil)
Optional.
-
#from : Tourmaline::User | Nil
Optional.
-
#from=(from : Tourmaline::User | Nil)
Optional.
-
#game : Tourmaline::Game | Nil
Optional.
-
#game=(game : Tourmaline::Game | Nil)
Optional.
-
#general_forum_topic_hidden : Tourmaline::GeneralForumTopicHidden | Nil
Optional.
-
#general_forum_topic_hidden=(general_forum_topic_hidden : Tourmaline::GeneralForumTopicHidden | Nil)
Optional.
-
#general_forum_topic_unhidden : Tourmaline::GeneralForumTopicUnhidden | Nil
Optional.
-
#general_forum_topic_unhidden=(general_forum_topic_unhidden : Tourmaline::GeneralForumTopicUnhidden | Nil)
Optional.
-
#group_chat_created=(group_chat_created : Bool | Nil)
Optional.
-
#group_chat_created? : Bool | Nil
Optional.
-
#has_media_spoiler=(has_media_spoiler : Bool | Nil)
Optional.
-
#has_media_spoiler? : Bool | Nil
Optional.
-
#has_protected_content=(has_protected_content : Bool | Nil)
Optional.
-
#has_protected_content? : Bool | Nil
Optional.
-
#invoice : Tourmaline::Invoice | Nil
Optional.
-
#invoice=(invoice : Tourmaline::Invoice | Nil)
Optional.
-
#is_automatic_forward=(is_automatic_forward : Bool | Nil)
Optional.
-
#is_automatic_forward? : Bool | Nil
Optional.
-
#is_topic_message=(is_topic_message : Bool | Nil)
Optional.
-
#is_topic_message? : Bool | Nil
Optional.
-
#left_chat_member : Tourmaline::User | Nil
Optional.
-
#left_chat_member=(left_chat_member : Tourmaline::User | Nil)
Optional.
- #link
-
#location : Tourmaline::Location | Nil
Optional.
-
#location=(location : Tourmaline::Location | Nil)
Optional.
-
#media_group_id : String | Nil
Optional.
-
#media_group_id=(media_group_id : String | Nil)
Optional.
-
#message_auto_delete_timer_changed : Tourmaline::MessageAutoDeleteTimerChanged | Nil
Optional.
-
#message_auto_delete_timer_changed=(message_auto_delete_timer_changed : Tourmaline::MessageAutoDeleteTimerChanged | Nil)
Optional.
-
#message_id : Int32 | Int64
Unique message identifier inside this chat
-
#message_id=(message_id : Int32 | Int64)
Unique message identifier inside this chat
-
#message_thread_id : Int32 | Int64 | Nil
Optional.
-
#message_thread_id=(message_thread_id : Int32 | Int64 | Nil)
Optional.
-
#migrate_from_chat_id : Int32 | Int64 | Nil
Optional.
-
#migrate_from_chat_id=(migrate_from_chat_id : Int32 | Int64 | Nil)
Optional.
-
#migrate_to_chat_id : Int32 | Int64 | Nil
Optional.
-
#migrate_to_chat_id=(migrate_to_chat_id : Int32 | Int64 | Nil)
Optional.
-
#new_chat_members : Array(Tourmaline::User)
Optional.
-
#new_chat_members=(new_chat_members : Array(Tourmaline::User))
Optional.
-
#new_chat_photo : Array(Tourmaline::PhotoSize)
Optional.
-
#new_chat_photo=(new_chat_photo : Array(Tourmaline::PhotoSize))
Optional.
-
#new_chat_title : String | Nil
Optional.
-
#new_chat_title=(new_chat_title : String | Nil)
Optional.
-
#passport_data : Tourmaline::PassportData | Nil
Optional.
-
#passport_data=(passport_data : Tourmaline::PassportData | Nil)
Optional.
-
#photo : Array(Tourmaline::PhotoSize)
Optional.
-
#photo=(photo : Array(Tourmaline::PhotoSize))
Optional.
-
#pinned_message : Tourmaline::Message | Nil
Optional.
-
#pinned_message=(pinned_message : Tourmaline::Message | Nil)
Optional.
-
#poll : Tourmaline::Poll | Nil
Optional.
-
#poll=(poll : Tourmaline::Poll | Nil)
Optional.
-
#proximity_alert_triggered : Tourmaline::ProximityAlertTriggered | Nil
Optional.
-
#proximity_alert_triggered=(proximity_alert_triggered : Tourmaline::ProximityAlertTriggered | Nil)
Optional.
-
#reply_markup : Tourmaline::InlineKeyboardMarkup | Nil
Optional.
-
#reply_markup=(reply_markup : Tourmaline::InlineKeyboardMarkup | Nil)
Optional.
-
#reply_to_message : Tourmaline::Message | Nil
Optional.
-
#reply_to_message=(reply_to_message : Tourmaline::Message | Nil)
Optional.
-
#sender_chat : Tourmaline::Chat | Nil
Optional.
-
#sender_chat=(sender_chat : Tourmaline::Chat | Nil)
Optional.
- #sender_type
-
#sticker : Tourmaline::Sticker | Nil
Optional.
-
#sticker=(sticker : Tourmaline::Sticker | Nil)
Optional.
-
#successful_payment : Tourmaline::SuccessfulPayment | Nil
Optional.
-
#successful_payment=(successful_payment : Tourmaline::SuccessfulPayment | Nil)
Optional.
-
#supergroup_chat_created=(supergroup_chat_created : Bool | Nil)
Optional.
-
#supergroup_chat_created? : Bool | Nil
Optional.
-
#text : String | Nil
Optional.
-
#text=(text : String | Nil)
Optional.
- #text_entities(type : String)
- #text_entities
-
#user_shared : Tourmaline::UserShared | Nil
Optional.
-
#user_shared=(user_shared : Tourmaline::UserShared | Nil)
Optional.
- #users
- #users(&block : User -> )
-
#venue : Tourmaline::Venue | Nil
Optional.
-
#venue=(venue : Tourmaline::Venue | Nil)
Optional.
-
#via_bot : Tourmaline::User | Nil
Optional.
-
#via_bot=(via_bot : Tourmaline::User | Nil)
Optional.
-
#video : Tourmaline::Video | Nil
Optional.
-
#video=(video : Tourmaline::Video | Nil)
Optional.
-
#video_chat_ended : Tourmaline::VideoChatEnded | Nil
Optional.
-
#video_chat_ended=(video_chat_ended : Tourmaline::VideoChatEnded | Nil)
Optional.
-
#video_chat_participants_invited : Tourmaline::VideoChatParticipantsInvited | Nil
Optional.
-
#video_chat_participants_invited=(video_chat_participants_invited : Tourmaline::VideoChatParticipantsInvited | Nil)
Optional.
-
#video_chat_scheduled : Tourmaline::VideoChatScheduled | Nil
Optional.
-
#video_chat_scheduled=(video_chat_scheduled : Tourmaline::VideoChatScheduled | Nil)
Optional.
-
#video_chat_started : Tourmaline::VideoChatStarted | Nil
Optional.
-
#video_chat_started=(video_chat_started : Tourmaline::VideoChatStarted | Nil)
Optional.
-
#video_note : Tourmaline::VideoNote | Nil
Optional.
-
#video_note=(video_note : Tourmaline::VideoNote | Nil)
Optional.
-
#voice : Tourmaline::Voice | Nil
Optional.
-
#voice=(voice : Tourmaline::Voice | Nil)
Optional.
-
#web_app_data : Tourmaline::WebAppData | Nil
Optional.
-
#web_app_data=(web_app_data : Tourmaline::WebAppData | Nil)
Optional.
-
#write_access_allowed : Tourmaline::WriteAccessAllowed | Nil
Optional.
-
#write_access_allowed=(write_access_allowed : Tourmaline::WriteAccessAllowed | Nil)
Optional.
Constructor Detail
Instance Method Detail
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
Optional. Message is an audio file, information about the file
Optional. Message is an audio file, information about the file
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
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.
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.
Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login
Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login
Optional. Message is a shared contact, information about the contact
Optional. Message is a shared contact, information about the contact
Optional. Service message: the chat photo was deleted
Optional. Message is a general file, information about the file
Optional. Message is a general file, information about the file
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
Optional. Service message: forum topic closed
Optional. Service message: forum topic closed
Optional. Service message: forum topic created
Optional. Service message: forum topic created
Optional. Service message: forum topic edited
Optional. Service message: forum topic edited
Optional. Service message: forum topic reopened
Optional. Service message: forum topic reopened
Optional. For forwarded messages, sender of the original message
Optional. For forwarded messages, sender of the original message
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
Optional. For messages forwarded from channels, identifier of the original message in the channel
Optional. For messages forwarded from channels, identifier of the original message in the channel
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
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.
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.
Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
Optional. Service message: the group has been created
Optional. True, if the message media is covered by a spoiler animation
Optional. True, if the message media is covered by a spoiler animation
Optional. True, if the message can't be forwarded
Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
Optional. True, if the message is sent to a forum topic
Optional. A member was removed from the group, information about them (this member may be the bot itself)
Optional. A member was removed from the group, information about them (this member may be the bot itself)
Optional. Message is a shared location, information about the location
Optional. Message is a shared location, information about the location
Optional. The unique identifier of a media message group this message belongs to
Optional. The unique identifier of a media message group this message belongs to
Optional. Service message: auto-delete timer settings changed in the chat
Optional. Service message: auto-delete timer settings changed in the chat
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
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.
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.
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.
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.
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
Optional. A chat photo was change to this value
Optional. A chat title was changed to this value
Optional. Telegram Passport data
Optional. Message is a photo, available sizes of the photo
Optional. Message is a photo, available sizes of the photo
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
Optional. Message is a native poll, information about the poll
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Optional. For replies, 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.
Optional. For replies, 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.
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.
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.
Optional. Message is a sticker, information about the sticker
Optional. Message is a sticker, information about the sticker
Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
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.
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.
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
Optional. Message is a video, information about the video
Optional. Service message: video chat ended
Optional. Service message: video chat ended
Optional. Service message: new participants invited to a video chat
Optional. Service message: new participants invited to a video chat
Optional. Service message: video chat scheduled
Optional. Service message: video chat scheduled
Optional. Service message: video chat started
Optional. Service message: video chat started
Optional. Message is a video note, information about the video message
Optional. Message is a video note, information about the video message
Optional. Message is a voice message, information about the file
Optional. Message is a voice message, information about the file
Optional. Service message: data sent by a Web App
Optional. Service message: the user allowed the bot added to the attachment menu to write messages
Optional. Service message: the user allowed the bot added to the attachment menu to write messages