Skip to content

GramIO API Reference / gramio/dist / TelegramMessage

Interface: TelegramMessage

Defined in: @gramio/types/out/objects.d.ts:501

This object represents a message.

Documentation

Properties

PropertyTypeDescriptionDefined in
animation?TelegramAnimationOptional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set@gramio/types/out/objects.d.ts:633
audio?TelegramAudioOptional. Message is an audio file, information about the file@gramio/types/out/objects.d.ts:637
author_signature?stringOptional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator@gramio/types/out/objects.d.ts:605
boost_added?TelegramChatBoostAddedOptional. Service message: user boosted the chat@gramio/types/out/objects.d.ts:821
business_connection_id?stringOptional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.@gramio/types/out/objects.d.ts:541
caption?stringOptional. Caption for the animation, audio, document, paid media, photo, video or voice@gramio/types/out/objects.d.ts:673
caption_entities?TelegramMessageEntity[]Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption@gramio/types/out/objects.d.ts:677
channel_chat_created?trueOptional. 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.@gramio/types/out/objects.d.ts:753
chatTelegramChatChat the message belongs to@gramio/types/out/objects.d.ts:545
chat_background_set?TelegramChatBackgroundOptional. Service message: chat background set@gramio/types/out/objects.d.ts:825
chat_owner_changed?TelegramChatOwnerChangedOptional. Service message: chat owner has changed@gramio/types/out/objects.d.ts:729
chat_owner_left?TelegramChatOwnerLeftOptional. Service message: chat owner has left@gramio/types/out/objects.d.ts:725
chat_shared?TelegramChatSharedOptional. Service message: a chat was shared with the bot@gramio/types/out/objects.d.ts:789
checklist?TelegramChecklistOptional. Message is a checklist@gramio/types/out/objects.d.ts:689
checklist_tasks_added?TelegramChecklistTasksAddedOptional. Service message: tasks were added to a checklist@gramio/types/out/objects.d.ts:833
checklist_tasks_done?TelegramChecklistTasksDoneOptional. Service message: some tasks in a checklist were marked as done or not done@gramio/types/out/objects.d.ts:829
connected_website?stringOptional. The domain name of the website on which the user has logged in. More about Telegram Login »@gramio/types/out/objects.d.ts:805
contact?TelegramContactOptional. Message is a shared contact, information about the contact@gramio/types/out/objects.d.ts:693
datenumberDate the message was sent in Unix time. It is always a positive number, representing a valid date.@gramio/types/out/objects.d.ts:537
delete_chat_photo?trueOptional. Service message: the chat photo was deleted@gramio/types/out/objects.d.ts:741
dice?TelegramDiceOptional. Message is a dice with random value@gramio/types/out/objects.d.ts:697
direct_message_price_changed?TelegramDirectMessagePriceChangedOptional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed@gramio/types/out/objects.d.ts:837
direct_messages_topic?TelegramDirectMessagesTopicOptional. Information about the direct messages chat topic that contains the message@gramio/types/out/objects.d.ts:513
document?TelegramDocumentOptional. Message is a general file, information about the file@gramio/types/out/objects.d.ts:641
edit_date?numberOptional. Date the message was last edited in Unix time@gramio/types/out/objects.d.ts:585
effect_id?stringOptional. Unique identifier of the message effect added to the message@gramio/types/out/objects.d.ts:629
entities?TelegramMessageEntity[]Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text@gramio/types/out/objects.d.ts:617
external_reply?TelegramExternalReplyInfoOptional. Information about the message that is being replied to, which may come from another chat or forum topic@gramio/types/out/objects.d.ts:565
forum_topic_closed?TelegramForumTopicClosedOptional. Service message: forum topic closed@gramio/types/out/objects.d.ts:849
forum_topic_created?TelegramForumTopicCreatedOptional. Service message: forum topic created@gramio/types/out/objects.d.ts:841
forum_topic_edited?TelegramForumTopicEditedOptional. Service message: forum topic edited@gramio/types/out/objects.d.ts:845
forum_topic_reopened?TelegramForumTopicReopenedOptional. Service message: forum topic reopened@gramio/types/out/objects.d.ts:853
forward_origin?TelegramMessageOriginOptional. Information about the original message for forwarded messages@gramio/types/out/objects.d.ts:549
from?TelegramUserOptional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats@gramio/types/out/objects.d.ts:517
game?TelegramGameOptional. Message is a game, information about the game. More about games »@gramio/types/out/objects.d.ts:701
general_forum_topic_hidden?TelegramGeneralForumTopicHiddenOptional. Service message: the 'General' forum topic hidden@gramio/types/out/objects.d.ts:857
general_forum_topic_unhidden?TelegramGeneralForumTopicUnhiddenOptional. Service message: the 'General' forum topic unhidden@gramio/types/out/objects.d.ts:861
gift?TelegramGiftInfoOptional. Service message: a regular gift was sent or received@gramio/types/out/objects.d.ts:793
gift_upgrade_sent?TelegramGiftInfoOptional. Service message: upgrade of a gift was purchased after the gift was sent@gramio/types/out/objects.d.ts:801
giveaway?TelegramGiveawayOptional. The message is a scheduled giveaway message@gramio/types/out/objects.d.ts:869
giveaway_completed?TelegramGiveawayCompletedOptional. Service message: a giveaway without public winners was completed@gramio/types/out/objects.d.ts:877
giveaway_created?TelegramGiveawayCreatedOptional. Service message: a scheduled giveaway was created@gramio/types/out/objects.d.ts:865
giveaway_winners?TelegramGiveawayWinnersOptional. A giveaway with public winners was completed@gramio/types/out/objects.d.ts:873
group_chat_created?trueOptional. Service message: the group has been created@gramio/types/out/objects.d.ts:745
has_media_spoiler?trueOptional. True, if the message media is covered by a spoiler animation@gramio/types/out/objects.d.ts:685
has_protected_content?trueOptional. True, if the message can't be forwarded@gramio/types/out/objects.d.ts:589
invoice?TelegramInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »@gramio/types/out/objects.d.ts:773
is_automatic_forward?trueOptional. True, if the message is a channel post that was automatically forwarded to the connected discussion group@gramio/types/out/objects.d.ts:557
is_from_offline?trueOptional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message@gramio/types/out/objects.d.ts:593
is_paid_post?trueOptional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.@gramio/types/out/objects.d.ts:597
is_topic_message?trueOptional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot@gramio/types/out/objects.d.ts:553
left_chat_member?TelegramUserOptional. A member was removed from the group, information about them (this member may be the bot itself)@gramio/types/out/objects.d.ts:721
link_preview_options?TelegramLinkPreviewOptionsOptional. Options used for link preview generation for the message, if it is a text message and link preview options were changed@gramio/types/out/objects.d.ts:621
location?TelegramLocationOptional. Message is a shared location, information about the location@gramio/types/out/objects.d.ts:713
media_group_id?stringOptional. The unique identifier inside this chat of a media message group this message belongs to@gramio/types/out/objects.d.ts:601
message_auto_delete_timer_changed?TelegramMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat@gramio/types/out/objects.d.ts:757
message_idnumberUnique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent@gramio/types/out/objects.d.ts:505
message_thread_id?numberOptional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only@gramio/types/out/objects.d.ts:509
migrate_from_chat_id?numberOptional. 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.@gramio/types/out/objects.d.ts:765
migrate_to_chat_id?numberOptional. 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.@gramio/types/out/objects.d.ts:761
new_chat_members?TelegramUser[]Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)@gramio/types/out/objects.d.ts:717
new_chat_photo?TelegramPhotoSize[]Optional. A chat photo was change to this value@gramio/types/out/objects.d.ts:737
new_chat_title?stringOptional. A chat title was changed to this value@gramio/types/out/objects.d.ts:733
paid_media?TelegramPaidMediaInfoOptional. Message contains paid media; information about the paid media@gramio/types/out/objects.d.ts:645
paid_message_price_changed?TelegramPaidMessagePriceChangedOptional. Service message: the price for paid messages has changed in the chat@gramio/types/out/objects.d.ts:881
paid_star_count?numberOptional. The number of Telegram Stars that were paid by the sender of the message to send it@gramio/types/out/objects.d.ts:609
passport_data?TelegramPassportDataOptional. Telegram Passport data@gramio/types/out/objects.d.ts:813
photo?TelegramPhotoSize[]Optional. Message is a photo, available sizes of the photo@gramio/types/out/objects.d.ts:649
pinned_message?TelegramMaybeInaccessibleMessageOptional. 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.@gramio/types/out/objects.d.ts:769
poll?TelegramPollOptional. Message is a native poll, information about the poll@gramio/types/out/objects.d.ts:705
proximity_alert_triggered?TelegramProximityAlertTriggeredOptional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.@gramio/types/out/objects.d.ts:817
quote?TelegramTextQuoteOptional. For replies that quote part of the original message, the quoted part of the message@gramio/types/out/objects.d.ts:569
refunded_payment?TelegramRefundedPaymentOptional. Message is a service message about a refunded payment, information about the payment. More about payments »@gramio/types/out/objects.d.ts:781
reply_markup?TelegramInlineKeyboardMarkup | { toJSON: TelegramInlineKeyboardMarkup; }Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.@gramio/types/out/objects.d.ts:925
reply_to_checklist_task_id?numberOptional. Identifier of the specific checklist task that is being replied to@gramio/types/out/objects.d.ts:577
reply_to_message?TelegramMessageOptional. 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.@gramio/types/out/objects.d.ts:561
reply_to_story?TelegramStoryOptional. For replies to a story, the original story@gramio/types/out/objects.d.ts:573
sender_boost_count?numberOptional. If the sender of the message boosted the chat, the number of boosts added by the user@gramio/types/out/objects.d.ts:525
sender_business_bot?TelegramUserOptional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.@gramio/types/out/objects.d.ts:529
sender_chat?TelegramChatOptional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.@gramio/types/out/objects.d.ts:521
sender_tag?stringOptional. Tag or custom title of the sender of the message; for supergroups only@gramio/types/out/objects.d.ts:533
show_caption_above_media?trueOptional. True, if the caption must be shown above the message media@gramio/types/out/objects.d.ts:681
sticker?TelegramStickerOptional. Message is a sticker, information about the sticker@gramio/types/out/objects.d.ts:653
story?TelegramStoryOptional. Message is a forwarded story@gramio/types/out/objects.d.ts:657
successful_payment?TelegramSuccessfulPaymentOptional. Message is a service message about a successful payment, information about the payment. More about payments »@gramio/types/out/objects.d.ts:777
suggested_post_approval_failed?TelegramSuggestedPostApprovalFailedOptional. Service message: approval of a suggested post has failed@gramio/types/out/objects.d.ts:889
suggested_post_approved?TelegramSuggestedPostApprovedOptional. Service message: a suggested post was approved@gramio/types/out/objects.d.ts:885
suggested_post_declined?TelegramSuggestedPostDeclinedOptional. Service message: a suggested post was declined@gramio/types/out/objects.d.ts:893
suggested_post_info?TelegramSuggestedPostInfoOptional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.@gramio/types/out/objects.d.ts:625
suggested_post_paid?TelegramSuggestedPostPaidOptional. Service message: payment for a suggested post was received@gramio/types/out/objects.d.ts:897
suggested_post_refunded?TelegramSuggestedPostRefundedOptional. Service message: payment for a suggested post was refunded@gramio/types/out/objects.d.ts:901
supergroup_chat_created?trueOptional. 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.@gramio/types/out/objects.d.ts:749
text?stringOptional. For text messages, the actual UTF-8 text of the message@gramio/types/out/objects.d.ts:613
unique_gift?TelegramUniqueGiftInfoOptional. Service message: a unique gift was sent or received@gramio/types/out/objects.d.ts:797
users_shared?TelegramUsersSharedOptional. Service message: users were shared with the bot@gramio/types/out/objects.d.ts:785
venue?TelegramVenueOptional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set@gramio/types/out/objects.d.ts:709
via_bot?TelegramUserOptional. Bot through which the message was sent@gramio/types/out/objects.d.ts:581
video?TelegramVideoOptional. Message is a video, information about the video@gramio/types/out/objects.d.ts:661
video_chat_ended?TelegramVideoChatEndedOptional. Service message: video chat ended@gramio/types/out/objects.d.ts:913
video_chat_participants_invited?TelegramVideoChatParticipantsInvitedOptional. Service message: new participants invited to a video chat@gramio/types/out/objects.d.ts:917
video_chat_scheduled?TelegramVideoChatScheduledOptional. Service message: video chat scheduled@gramio/types/out/objects.d.ts:905
video_chat_started?TelegramVideoChatStartedOptional. Service message: video chat started@gramio/types/out/objects.d.ts:909
video_note?TelegramVideoNoteOptional. Message is a video note, information about the video message@gramio/types/out/objects.d.ts:665
voice?TelegramVoiceOptional. Message is a voice message, information about the file@gramio/types/out/objects.d.ts:669
web_app_data?TelegramWebAppDataOptional. Service message: data sent by a Web App@gramio/types/out/objects.d.ts:921
write_access_allowed?TelegramWriteAccessAllowedOptional. 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@gramio/types/out/objects.d.ts:809