class Telegram::API::Message
- Telegram::API::Message
- Telegram::API::Type
- Reference
- Object
Overview
This object represents a message.
Defined in:
telegram/api/generated/types.crtelegram/api/overrides/message.cr
Constructors
- .new(message_id : Int32, date : Time, chat : Chat, from : User | Nil = nil, sender_chat : Chat | Nil = nil, forward_from : User | Nil = nil, forward_from_chat : Chat | Nil = nil, forward_from_message_id : Int32 | Nil = nil, forward_signature : String | Nil = nil, forward_sender_name : String | Nil = nil, forward_date : Time | Nil = nil, is_automatic_forward : Bool | Nil = nil, reply_to_message : Message | Nil = nil, via_bot : User | Nil = nil, edit_date : Time | Nil = nil, has_protected_content : Bool | Nil = nil, media_group_id : String | Nil = nil, author_signature : String | Nil = nil, text : String | Nil = nil, animation : Animation | Nil = nil, audio : Audio | Nil = nil, document : Document | Nil = nil, sticker : Sticker | Nil = nil, video : Video | Nil = nil, video_note : VideoNote | Nil = nil, voice : Voice | Nil = nil, caption : String | Nil = nil, contact : Contact | Nil = nil, dice : Dice | Nil = nil, game : Game | Nil = nil, poll : Poll | Nil = nil, venue : Venue | Nil = nil, location : Location | Nil = nil, left_chat_member : User | Nil = nil, new_chat_title : String | Nil = nil, 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 : MessageAutoDeleteTimerChanged | Nil = nil, migrate_to_chat_id : Int32 | Nil = nil, migrate_from_chat_id : Int32 | Nil = nil, pinned_message : Message | Nil = nil, invoice : Invoice | Nil = nil, successful_payment : SuccessfulPayment | Nil = nil, connected_website : String | Nil = nil, passport_data : PassportData | Nil = nil, proximity_alert_triggered : ProximityAlertTriggered | Nil = nil, voice_chat_scheduled : VoiceChatScheduled | Nil = nil, voice_chat_started : VoiceChatStarted | Nil = nil, voice_chat_ended : VoiceChatEnded | Nil = nil, voice_chat_participants_invited : VoiceChatParticipantsInvited | Nil = nil, reply_markup : InlineKeyboardMarkup | Nil = nil, entities : Array(MessageEntity) = Array(MessageEntity).new, photo : Array(PhotoSize) = Array(PhotoSize).new, caption_entities : Array(MessageEntity) = Array(MessageEntity).new, new_chat_members : Array(User) = Array(User).new, new_chat_photo : Array(PhotoSize) = Array(PhotoSize).new)
-
.new(pull : JSON::PullParser)
This object represents a message.
Instance Method Summary
-
#animation : Animation | Nil
Optional.
-
#animation=(animation : Animation | Nil)
Optional.
-
#audio : Audio | Nil
Optional.
-
#audio=(audio : 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(MessageEntity)
Optional.
-
#caption_entities=(caption_entities : Array(MessageEntity))
Optional.
-
#channel_chat_created : Bool | Nil
Optional.
-
#channel_chat_created=(channel_chat_created : Bool | Nil)
Optional.
-
#chat : Chat
Conversation the message belongs to
-
#chat=(chat : Chat)
Conversation the message belongs to
- #chats
- #chats(&block : Chat -> )
-
#connected_website : String | Nil
Optional.
-
#connected_website=(connected_website : String | Nil)
Optional.
-
#contact : Contact | Nil
Optional.
-
#contact=(contact : Contact | Nil)
Optional.
-
#date : Time
Date the message was sent in Unix time
-
#date=(date : Time)
Date the message was sent in Unix time
-
#delete
Delete the message.
-
#delete_chat_photo : Bool | Nil
Optional.
-
#delete_chat_photo=(delete_chat_photo : Bool | Nil)
Optional.
-
#dice : Dice | Nil
Optional.
-
#dice=(dice : Dice | Nil)
Optional.
-
#document : Document | Nil
Optional.
-
#document=(document : Document | Nil)
Optional.
-
#edit_caption(caption, **kwargs)
Edits the message's caption.
-
#edit_date : Time | Nil
Optional.
-
#edit_date=(edit_date : Time | Nil)
Optional.
-
#edit_live_location(latitude, longitude, **kwargs)
Edits the message's live_location.
-
#edit_media(media, **kwargs)
Edits the message's media.
-
#edit_reply_markup(reply_markup)
Set the reply markup for the message.
-
#edit_text(text, **kwargs)
Edits the text of a message.
-
#entities : Array(MessageEntity)
Optional.
-
#entities=(entities : Array(MessageEntity))
Optional.
- #file
-
#forward(to_chat, **kwargs)
Forward the message to another chat.
-
#forward_date : Time | Nil
Optional.
-
#forward_date=(forward_date : Time | Nil)
Optional.
-
#forward_from : User | Nil
Optional.
-
#forward_from=(forward_from : User | Nil)
Optional.
-
#forward_from_chat : Chat | Nil
Optional.
-
#forward_from_chat=(forward_from_chat : Chat | Nil)
Optional.
-
#forward_from_message_id : Int32 | Nil
Optional.
-
#forward_from_message_id=(forward_from_message_id : Int32 | 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 : User | Nil
Optional.
-
#from=(from : User | Nil)
Optional.
-
#game : Game | Nil
Optional.
-
#game=(game : Game | Nil)
Optional.
-
#group_chat_created : Bool | Nil
Optional.
-
#group_chat_created=(group_chat_created : Bool | Nil)
Optional.
-
#has_protected_content : Bool | Nil
Optional.
-
#has_protected_content=(has_protected_content : Bool | Nil)
Optional.
-
#invoice : Invoice | Nil
Optional.
-
#invoice=(invoice : Invoice | Nil)
Optional.
-
#is_automatic_forward : Bool | Nil
Optional.
-
#is_automatic_forward=(is_automatic_forward : Bool | Nil)
Optional.
-
#left_chat_member : User | Nil
Optional.
-
#left_chat_member=(left_chat_member : User | Nil)
Optional.
- #link
-
#location : Location | Nil
Optional.
-
#location=(location : Location | Nil)
Optional.
-
#media_group_id : String | Nil
Optional.
-
#media_group_id=(media_group_id : String | Nil)
Optional.
-
#message_auto_delete_timer_changed : MessageAutoDeleteTimerChanged | Nil
Optional.
-
#message_auto_delete_timer_changed=(message_auto_delete_timer_changed : MessageAutoDeleteTimerChanged | Nil)
Optional.
-
#message_id : Int32
Unique message identifier inside this chat
-
#message_id=(message_id : Int32)
Unique message identifier inside this chat
-
#migrate_from_chat_id : Int32 | Nil
Optional.
-
#migrate_from_chat_id=(migrate_from_chat_id : Int32 | Nil)
Optional.
-
#migrate_to_chat_id : Int32 | Nil
Optional.
-
#migrate_to_chat_id=(migrate_to_chat_id : Int32 | Nil)
Optional.
-
#new_chat_members : Array(User)
Optional.
-
#new_chat_members=(new_chat_members : Array(User))
Optional.
-
#new_chat_photo : Array(PhotoSize)
Optional.
-
#new_chat_photo=(new_chat_photo : Array(PhotoSize))
Optional.
-
#new_chat_title : String | Nil
Optional.
-
#new_chat_title=(new_chat_title : String | Nil)
Optional.
-
#passport_data : PassportData | Nil
Optional.
-
#passport_data=(passport_data : PassportData | Nil)
Optional.
-
#photo : Array(PhotoSize)
Optional.
-
#photo=(photo : Array(PhotoSize))
Optional.
-
#pin(**kwargs)
Pin the message.
-
#pinned_message : Message | Nil
Optional.
-
#pinned_message=(pinned_message : Message | Nil)
Optional.
-
#poll : Poll | Nil
Optional.
-
#poll=(poll : Poll | Nil)
Optional.
-
#proximity_alert_triggered : ProximityAlertTriggered | Nil
Optional.
-
#proximity_alert_triggered=(proximity_alert_triggered : ProximityAlertTriggered | Nil)
Optional.
- #raw_caption(parse_mode : ParseMode = :markdown)
- #raw_text(parse_mode : ParseMode = :markdown)
-
#reply(message, **kwargs)
Reply to a message.
-
#reply_markup : InlineKeyboardMarkup | Nil
Optional.
-
#reply_markup=(reply_markup : InlineKeyboardMarkup | Nil)
Optional.
-
#reply_to_message : Message | Nil
Optional.
-
#reply_to_message=(reply_to_message : Message | Nil)
Optional.
- #reply_with_animation(*args, **kwargs)
- #reply_with_audio(*args, **kwargs)
- #reply_with_basketball(*args, **kwargs)
- #reply_with_contact(*args, **kwargs)
- #reply_with_dart(*args, **kwargs)
- #reply_with_dice(*args, **kwargs)
- #reply_with_document(*args, **kwargs)
- #reply_with_invoice(*args, **kwargs)
- #reply_with_location(*args, **kwargs)
- #reply_with_media_group(*args, **kwargs)
- #reply_with_photo(*args, **kwargs)
- #reply_with_poll(*args, **kwargs)
- #reply_with_sticker(*args, **kwargs)
- #reply_with_venu(*args, **kwargs)
- #reply_with_video(*args, **kwargs)
- #reply_with_video_note(*args, **kwargs)
- #reply_with_voice(*args, **kwargs)
-
#respond(message, **kwargs)
Respond to a message.
- #respond_with_animation(*args, **kwargs)
- #respond_with_audio(*args, **kwargs)
- #respond_with_basketball(*args, **kwargs)
- #respond_with_contact(*args, **kwargs)
- #respond_with_dart(*args, **kwargs)
- #respond_with_dice(*args, **kwargs)
- #respond_with_document(*args, **kwargs)
- #respond_with_invoice(*args, **kwargs)
- #respond_with_location(*args, **kwargs)
- #respond_with_media_group(*args, **kwargs)
- #respond_with_photo(*args, **kwargs)
- #respond_with_poll(*args, **kwargs)
- #respond_with_sticker(*args, **kwargs)
- #respond_with_venu(*args, **kwargs)
- #respond_with_video(*args, **kwargs)
- #respond_with_video_note(*args, **kwargs)
- #respond_with_voice(*args, **kwargs)
-
#sender_chat : Chat | Nil
Optional.
-
#sender_chat=(sender_chat : Chat | Nil)
Optional.
- #sender_type
-
#sticker : Sticker | Nil
Optional.
-
#sticker=(sticker : Sticker | Nil)
Optional.
- #stop_live_location(**kwargs)
-
#successful_payment : SuccessfulPayment | Nil
Optional.
-
#successful_payment=(successful_payment : SuccessfulPayment | Nil)
Optional.
-
#supergroup_chat_created : Bool | Nil
Optional.
-
#supergroup_chat_created=(supergroup_chat_created : Bool | Nil)
Optional.
-
#text : String | Nil
Optional.
-
#text=(text : String | Nil)
Optional.
- #text_entities
-
#unpin(**kwargs)
Unpin the message.
- #users
- #users(&block : User -> )
-
#venue : Venue | Nil
Optional.
-
#venue=(venue : Venue | Nil)
Optional.
-
#via_bot : User | Nil
Optional.
-
#via_bot=(via_bot : User | Nil)
Optional.
-
#video : Video | Nil
Optional.
-
#video=(video : Video | Nil)
Optional.
-
#video_note : VideoNote | Nil
Optional.
-
#video_note=(video_note : VideoNote | Nil)
Optional.
-
#voice : Voice | Nil
Optional.
-
#voice=(voice : Voice | Nil)
Optional.
-
#voice_chat_ended : VoiceChatEnded | Nil
Optional.
-
#voice_chat_ended=(voice_chat_ended : VoiceChatEnded | Nil)
Optional.
-
#voice_chat_participants_invited : VoiceChatParticipantsInvited | Nil
Optional.
-
#voice_chat_participants_invited=(voice_chat_participants_invited : VoiceChatParticipantsInvited | Nil)
Optional.
-
#voice_chat_scheduled : VoiceChatScheduled | Nil
Optional.
-
#voice_chat_scheduled=(voice_chat_scheduled : VoiceChatScheduled | Nil)
Optional.
-
#voice_chat_started : VoiceChatStarted | Nil
Optional.
-
#voice_chat_started=(voice_chat_started : VoiceChatStarted | 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
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. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
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
Edits the message's caption. See Telegram::API#edit_message_caption
Edits the message's live_location. See Telegram::API#edit_message_live_location
Set the reply markup for the message. See Telegram::API#edit_message_reply_markup
.
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
Forward the message to another chat. See Telegram::API#forward_message
.
Optional. For forwarded messages, date the original message was sent in Unix time
Optional. For forwarded messages, date the original message was sent in Unix time
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 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. 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. 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 photo was change to this value
Optional. A chat title was changed to this value
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. 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. For text messages, the actual UTF-8 text of the message, 0-4096 characters
Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
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. 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: voice chat ended
Optional. Service message: new participants invited to a voice chat
Optional. Service message: new participants invited to a voice chat
Optional. Service message: voice chat scheduled
Optional. Service message: voice chat scheduled
Optional. Service message: voice chat started