Skip to content

GramIO API Reference / gramio/dist / TelegramMessage

Interface: TelegramMessage

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

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:697
audio?TelegramAudioOptional. Message is an audio file, information about the file@gramio/types/out/objects.d.ts:701
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:665
boost_added?TelegramChatBoostAddedOptional. Service message: user boosted the chat@gramio/types/out/objects.d.ts:889
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:589
caption?stringOptional. Caption for the animation, audio, document, paid media, photo, video or voice@gramio/types/out/objects.d.ts:741
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:745
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:821
chatTelegramChatChat the message belongs to@gramio/types/out/objects.d.ts:593
chat_background_set?TelegramChatBackgroundOptional. Service message: chat background set@gramio/types/out/objects.d.ts:893
chat_owner_changed?TelegramChatOwnerChangedOptional. Service message: chat owner has changed@gramio/types/out/objects.d.ts:797
chat_owner_left?TelegramChatOwnerLeftOptional. Service message: chat owner has left@gramio/types/out/objects.d.ts:793
chat_shared?TelegramChatSharedOptional. Service message: a chat was shared with the bot@gramio/types/out/objects.d.ts:857
checklist?TelegramChecklistOptional. Message is a checklist@gramio/types/out/objects.d.ts:757
checklist_tasks_added?TelegramChecklistTasksAddedOptional. Service message: tasks were added to a checklist@gramio/types/out/objects.d.ts:901
checklist_tasks_done?TelegramChecklistTasksDoneOptional. Service message: some tasks in a checklist were marked as done or not done@gramio/types/out/objects.d.ts:897
community_chat_added?TelegramCommunityChatAddedOptional. Service message: chat or bot added to a Community@gramio/types/out/objects.d.ts:905
community_chat_joined?TelegramCommunityChatJoinedOptional. Service message: chat was joined by a user from a Community@gramio/types/out/objects.d.ts:909
community_chat_removed?TelegramCommunityChatRemovedOptional. Service message: chat or bot removed from a Community@gramio/types/out/objects.d.ts:913
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:873
contact?TelegramContactOptional. Message is a shared contact, information about the contact@gramio/types/out/objects.d.ts:761
datenumberDate the message was sent in Unix time. It is always a positive number, representing a valid date.@gramio/types/out/objects.d.ts:581
delete_chat_photo?trueOptional. Service message: the chat photo was deleted@gramio/types/out/objects.d.ts:809
dice?TelegramDiceOptional. Message is a dice with random value@gramio/types/out/objects.d.ts:765
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:917
direct_messages_topic?TelegramDirectMessagesTopicOptional. Information about the direct messages chat topic that contains the message@gramio/types/out/objects.d.ts:549
document?TelegramDocumentOptional. Message is a general file, information about the file@gramio/types/out/objects.d.ts:705
edit_date?numberOptional. Date the message was last edited in Unix time@gramio/types/out/objects.d.ts:645
effect_id?stringOptional. Unique identifier of the message effect added to the message@gramio/types/out/objects.d.ts:689
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:677
ephemeral_message_id?numberOptional. For ephemeral messages, identifier of the ephemeral message inside this chat. The identifier may be reused for another ephemeral message after the message is deleted or expires.@gramio/types/out/objects.d.ts:577
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:613
forum_topic_closed?TelegramForumTopicClosedOptional. Service message: forum topic closed@gramio/types/out/objects.d.ts:929
forum_topic_created?TelegramForumTopicCreatedOptional. Service message: forum topic created@gramio/types/out/objects.d.ts:921
forum_topic_edited?TelegramForumTopicEditedOptional. Service message: forum topic edited@gramio/types/out/objects.d.ts:925
forum_topic_reopened?TelegramForumTopicReopenedOptional. Service message: forum topic reopened@gramio/types/out/objects.d.ts:933
forward_origin?TelegramMessageOriginOptional. Information about the original message for forwarded messages@gramio/types/out/objects.d.ts:597
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:553
game?TelegramGameOptional. Message is a game, information about the game. More about games »@gramio/types/out/objects.d.ts:769
general_forum_topic_hidden?TelegramGeneralForumTopicHiddenOptional. Service message: the 'General' forum topic hidden@gramio/types/out/objects.d.ts:937
general_forum_topic_unhidden?TelegramGeneralForumTopicUnhiddenOptional. Service message: the 'General' forum topic unhidden@gramio/types/out/objects.d.ts:941
gift?TelegramGiftInfoOptional. Service message: a regular gift was sent or received@gramio/types/out/objects.d.ts:861
gift_upgrade_sent?TelegramGiftInfoOptional. Service message: upgrade of a gift was purchased after the gift was sent@gramio/types/out/objects.d.ts:869
giveaway?TelegramGiveawayOptional. The message is a scheduled giveaway message@gramio/types/out/objects.d.ts:949
giveaway_completed?TelegramGiveawayCompletedOptional. Service message: a giveaway without public winners was completed@gramio/types/out/objects.d.ts:957
giveaway_created?TelegramGiveawayCreatedOptional. Service message: a scheduled giveaway was created@gramio/types/out/objects.d.ts:945
giveaway_winners?TelegramGiveawayWinnersOptional. A giveaway with public winners was completed@gramio/types/out/objects.d.ts:953
group_chat_created?trueOptional. Service message: the group has been created@gramio/types/out/objects.d.ts:813
guest_bot_caller_chat?TelegramChatOptional. For a message sent by a guest bot, this is the chat whose original message triggered the bot's response@gramio/types/out/objects.d.ts:641
guest_bot_caller_user?TelegramUserOptional. For a message sent by a guest bot, this is the user whose original message triggered the bot's response@gramio/types/out/objects.d.ts:637
guest_query_id?stringOptional. The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier.@gramio/types/out/objects.d.ts:585
has_media_spoiler?trueOptional. True, if the message media is covered by a spoiler animation@gramio/types/out/objects.d.ts:753
has_protected_content?trueOptional. True, if the message can't be forwarded@gramio/types/out/objects.d.ts:649
invoice?TelegramInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »@gramio/types/out/objects.d.ts:841
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:605
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:653
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:657
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:601
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:789
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:681
live_photo?TelegramLivePhotoOptional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.@gramio/types/out/objects.d.ts:709
location?TelegramLocationOptional. Message is a shared location, information about the location@gramio/types/out/objects.d.ts:781
managed_bot_created?TelegramManagedBotCreatedOptional. Service message: user created a bot that will be managed by the current bot@gramio/types/out/objects.d.ts:961
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:661
message_auto_delete_timer_changed?TelegramMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat@gramio/types/out/objects.d.ts:825
message_idnumberUnique message identifier inside this chat; 0 for ephemeral messages. In specific instances (e.g., a 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:541
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:545
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:833
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:829
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:785
new_chat_photo?TelegramPhotoSize[]Optional. A chat photo was change to this value@gramio/types/out/objects.d.ts:805
new_chat_title?stringOptional. A chat title was changed to this value@gramio/types/out/objects.d.ts:801
paid_media?TelegramPaidMediaInfoOptional. Message contains paid media; information about the paid media@gramio/types/out/objects.d.ts:713
paid_message_price_changed?TelegramPaidMessagePriceChangedOptional. Service message: the price for paid messages has changed in the chat@gramio/types/out/objects.d.ts:965
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:669
passport_data?TelegramPassportDataOptional. Telegram Passport data@gramio/types/out/objects.d.ts:881
photo?TelegramPhotoSize[]Optional. Message is a photo, available sizes of the photo@gramio/types/out/objects.d.ts:717
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:837
poll?TelegramPollOptional. Message is a native poll, information about the poll@gramio/types/out/objects.d.ts:773
poll_option_added?TelegramPollOptionAddedOptional. Service message: answer option was added to a poll@gramio/types/out/objects.d.ts:969
poll_option_deleted?TelegramPollOptionDeletedOptional. Service message: answer option was deleted from a poll@gramio/types/out/objects.d.ts:973
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:885
quote?TelegramTextQuoteOptional. For replies that quote part of the original message, the quoted part of the message@gramio/types/out/objects.d.ts:617
receiver_user?TelegramUserOptional. For ephemeral messages, the user who received the message@gramio/types/out/objects.d.ts:573
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:849
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:1017
reply_to_checklist_task_id?numberOptional. Identifier of the specific checklist task that is being replied to@gramio/types/out/objects.d.ts:625
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. If the message is a reply to an ephemeral message, then this field may be omitted.@gramio/types/out/objects.d.ts:609
reply_to_poll_option_id?stringOptional. Persistent identifier of the specific poll option that is being replied to@gramio/types/out/objects.d.ts:629
reply_to_story?TelegramStoryOptional. For replies to a story, the original story@gramio/types/out/objects.d.ts:621
rich_message?TelegramRichMessageOptional. Message is a rich formatted message@gramio/types/out/objects.d.ts:693
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:561
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:565
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:557
sender_tag?stringOptional. Tag or custom title of the sender of the message; for supergroups only@gramio/types/out/objects.d.ts:569
show_caption_above_media?trueOptional. True, if the caption must be shown above the message media@gramio/types/out/objects.d.ts:749
sticker?TelegramStickerOptional. Message is a sticker, information about the sticker@gramio/types/out/objects.d.ts:721
story?TelegramStoryOptional. Message is a forwarded story@gramio/types/out/objects.d.ts:725
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:845
suggested_post_approval_failed?TelegramSuggestedPostApprovalFailedOptional. Service message: approval of a suggested post has failed@gramio/types/out/objects.d.ts:981
suggested_post_approved?TelegramSuggestedPostApprovedOptional. Service message: a suggested post was approved@gramio/types/out/objects.d.ts:977
suggested_post_declined?TelegramSuggestedPostDeclinedOptional. Service message: a suggested post was declined@gramio/types/out/objects.d.ts:985
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:685
suggested_post_paid?TelegramSuggestedPostPaidOptional. Service message: payment for a suggested post was received@gramio/types/out/objects.d.ts:989
suggested_post_refunded?TelegramSuggestedPostRefundedOptional. Service message: payment for a suggested post was refunded@gramio/types/out/objects.d.ts:993
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:817
text?stringOptional. For text messages, the actual UTF-8 text of the message@gramio/types/out/objects.d.ts:673
unique_gift?TelegramUniqueGiftInfoOptional. Service message: a unique gift was sent or received@gramio/types/out/objects.d.ts:865
users_shared?TelegramUsersSharedOptional. Service message: users were shared with the bot@gramio/types/out/objects.d.ts:853
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:777
via_bot?TelegramUserOptional. Bot through which the message was sent@gramio/types/out/objects.d.ts:633
video?TelegramVideoOptional. Message is a video, information about the video@gramio/types/out/objects.d.ts:729
video_chat_ended?TelegramVideoChatEndedOptional. Service message: video chat ended@gramio/types/out/objects.d.ts:1005
video_chat_participants_invited?TelegramVideoChatParticipantsInvitedOptional. Service message: new participants invited to a video chat@gramio/types/out/objects.d.ts:1009
video_chat_scheduled?TelegramVideoChatScheduledOptional. Service message: video chat scheduled@gramio/types/out/objects.d.ts:997
video_chat_started?TelegramVideoChatStartedOptional. Service message: video chat started@gramio/types/out/objects.d.ts:1001
video_note?TelegramVideoNoteOptional. Message is a video note, information about the video message@gramio/types/out/objects.d.ts:733
voice?TelegramVoiceOptional. Message is a voice message, information about the file@gramio/types/out/objects.d.ts:737
web_app_data?TelegramWebAppDataOptional. Service message: data sent by a Web App@gramio/types/out/objects.d.ts:1013
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:877