Message

Raw MD
This object represents a message

This object represents a message.

Fields

FieldTypeRequiredDescription
message_idIntegerAlwaysUnique 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.
message_thread_idIntegerOptionalUnique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
direct_messages_topicDirectMessagesTopicOptionalInformation about the direct messages chat topic that contains the message
fromUserOptionalSender 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.
sender_chatChatOptionalSender 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.
sender_boost_countIntegerOptionalIf the sender of the message boosted the chat, the number of boosts added by the user
sender_business_botUserOptionalThe 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.
sender_tagStringOptionalTag or custom title of the sender of the message; for supergroups only
receiver_userUserOptionalFor ephemeral messages, the user who received the message
ephemeral_message_idIntegerOptionalFor 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.
dateIntegerAlwaysDate the message was sent in Unix time. It is always a positive number, representing a valid date.
guest_query_idStringOptionalThe 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.
business_connection_idStringOptionalUnique 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.
chatChatAlwaysChat the message belongs to
forward_originMessageOriginOptionalInformation about the original message for forwarded messages
is_topic_messageTrueOptionalTrue, if the message is sent to a topic in a forum supergroup or a private chat with the bot
is_automatic_forwardTrueOptionalTrue, if the message is a channel post that was automatically forwarded to the connected discussion group
reply_to_messageMessageOptionalFor 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.
external_replyExternalReplyInfoOptionalInformation about the message that is being replied to, which may come from another chat or forum topic
quoteTextQuoteOptionalFor replies that quote part of the original message, the quoted part of the message
reply_to_storyStoryOptionalFor replies to a story, the original story
reply_to_checklist_task_idIntegerOptionalIdentifier of the specific checklist task that is being replied to
reply_to_poll_option_idStringOptionalPersistent identifier of the specific poll option that is being replied to
via_botUserOptionalBot through which the message was sent
guest_bot_caller_userUserOptionalFor a message sent by a guest bot, this is the user whose original message triggered the bot's response
guest_bot_caller_chatChatOptionalFor a message sent by a guest bot, this is the chat whose original message triggered the bot's response
edit_dateIntegerOptionalDate the message was last edited in Unix time
has_protected_contentTrueOptionalTrue, if the message can't be forwarded
is_from_offlineTrueOptionalTrue, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
is_paid_postTrueOptionalTrue, 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.
media_group_idStringOptionalThe unique identifier inside this chat of a media message group this message belongs to
author_signatureStringOptionalSignature of the post author for messages in channels, or the custom title of an anonymous group administrator
paid_star_countIntegerOptionalThe number of Telegram Stars that were paid by the sender of the message to send it
textStringOptionalFor text messages, the actual UTF-8 text of the message
entitiesArray of MessageEntityOptionalFor text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
link_preview_optionsLinkPreviewOptionsOptionalOptions used for link preview generation for the message, if it is a text message and link preview options were changed
suggested_post_infoSuggestedPostInfoOptionalInformation 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.
effect_idStringOptionalUnique identifier of the message effect added to the message
rich_messageRichMessageOptionalMessage is a rich formatted message
animationAnimationOptionalMessage is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
audioAudioOptionalMessage is an audio file, information about the file
documentDocumentOptionalMessage is a general file, information about the file
live_photoLivePhotoOptionalMessage is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.
paid_mediaPaidMediaInfoOptionalMessage contains paid media; information about the paid media
photoArray of PhotoSizeOptionalMessage is a photo, available sizes of the photo
stickerStickerOptionalMessage is a sticker, information about the sticker
storyStoryOptionalMessage is a forwarded story
videoVideoOptionalMessage is a video, information about the video
video_noteVideoNoteOptionalMessage is a video note, information about the video message
voiceVoiceOptionalMessage is a voice message, information about the file
captionStringOptionalCaption for the animation, audio, document, paid media, photo, video or voice
caption_entitiesArray of MessageEntityOptionalFor messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
show_caption_above_mediaTrueOptionalTrue, if the caption must be shown above the message media
has_media_spoilerTrueOptionalTrue, if the message media is covered by a spoiler animation
checklistChecklistOptionalMessage is a checklist
contactContactOptionalMessage is a shared contact, information about the contact
diceDiceOptionalMessage is a dice with random value
gameGameOptionalMessage is a game, information about the game. More about games »
pollPollOptionalMessage is a native poll, information about the poll
venueVenueOptionalMessage is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
locationLocationOptionalMessage is a shared location, information about the location
new_chat_membersArray of UserOptionalNew members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
left_chat_memberUserOptionalA member was removed from the group, information about them (this member may be the bot itself)
chat_owner_leftChatOwnerLeftOptionalService message: chat owner has left
chat_owner_changedChatOwnerChangedOptionalService message: chat owner has changed
new_chat_titleStringOptionalA chat title was changed to this value
new_chat_photoArray of PhotoSizeOptionalA chat photo was change to this value
delete_chat_photoTrueOptionalService message: the chat photo was deleted
group_chat_createdTrueOptionalService message: the group has been created
supergroup_chat_createdTrueOptionalService 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.
channel_chat_createdTrueOptionalService 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.
message_auto_delete_timer_changedMessageAutoDeleteTimerChangedOptionalService message: auto-delete timer settings changed in the chat
migrate_to_chat_idIntegerOptionalThe 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.
migrate_from_chat_idIntegerOptionalThe 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.
pinned_messageMaybeInaccessibleMessageOptionalSpecified 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.
invoiceInvoiceOptionalMessage is an invoice for a payment, information about the invoice. More about payments »
successful_paymentSuccessfulPaymentOptionalMessage is a service message about a successful payment, information about the payment. More about payments »
refunded_paymentRefundedPaymentOptionalMessage is a service message about a refunded payment, information about the payment. More about payments »
users_sharedUsersSharedOptionalService message: users were shared with the bot
chat_sharedChatSharedOptionalService message: a chat was shared with the bot
giftGiftInfoOptionalService message: a regular gift was sent or received
unique_giftUniqueGiftInfoOptionalService message: a unique gift was sent or received
gift_upgrade_sentGiftInfoOptionalService message: upgrade of a gift was purchased after the gift was sent
connected_websiteStringOptionalThe domain name of the website on which the user has logged in. More about Telegram Login »
write_access_allowedWriteAccessAllowedOptionalService 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
passport_dataPassportDataOptionalTelegram Passport data
proximity_alert_triggeredProximityAlertTriggeredOptionalService message: a user in the chat triggered another user's proximity alert while sharing Live Location
boost_addedChatBoostAddedOptionalService message: user boosted the chat
chat_background_setChatBackgroundOptionalService message: chat background set
checklist_tasks_doneChecklistTasksDoneOptionalService message: some tasks in a checklist were marked as done or not done
checklist_tasks_addedChecklistTasksAddedOptionalService message: tasks were added to a checklist
community_chat_addedCommunityChatAddedOptionalService message: chat or bot added to a Community
community_chat_joinedCommunityChatJoinedOptionalService message: chat was joined by a user from a Community
community_chat_removedCommunityChatRemovedOptionalService message: chat or bot removed from a Community
direct_message_price_changedDirectMessagePriceChangedOptionalService message: the price for paid messages in the corresponding direct messages chat of a channel has changed
forum_topic_createdForumTopicCreatedOptionalService message: forum topic created
forum_topic_editedForumTopicEditedOptionalService message: forum topic edited
forum_topic_closedForumTopicClosedOptionalService message: forum topic closed
forum_topic_reopenedForumTopicReopenedOptionalService message: forum topic reopened
general_forum_topic_hiddenGeneralForumTopicHiddenOptionalService message: the 'General' forum topic hidden
general_forum_topic_unhiddenGeneralForumTopicUnhiddenOptionalService message: the 'General' forum topic unhidden
giveaway_createdGiveawayCreatedOptionalService message: a scheduled giveaway was created
giveawayGiveawayOptionalThe message is a scheduled giveaway message
giveaway_winnersGiveawayWinnersOptionalA giveaway with public winners was completed
giveaway_completedGiveawayCompletedOptionalService message: a giveaway without public winners was completed
managed_bot_createdManagedBotCreatedOptionalService message: user created a bot that will be managed by the current bot
paid_message_price_changedPaidMessagePriceChangedOptionalService message: the price for paid messages has changed in the chat
poll_option_addedPollOptionAddedOptionalService message: answer option was added to a poll
poll_option_deletedPollOptionDeletedOptionalService message: answer option was deleted from a poll
suggested_post_approvedSuggestedPostApprovedOptionalService message: a suggested post was approved
suggested_post_approval_failedSuggestedPostApprovalFailedOptionalService message: approval of a suggested post has failed
suggested_post_declinedSuggestedPostDeclinedOptionalService message: a suggested post was declined
suggested_post_paidSuggestedPostPaidOptionalService message: payment for a suggested post was received
suggested_post_refundedSuggestedPostRefundedOptionalService message: payment for a suggested post was refunded
video_chat_scheduledVideoChatScheduledOptionalService message: video chat scheduled
video_chat_startedVideoChatStartedOptionalService message: video chat started
video_chat_endedVideoChatEndedOptionalService message: video chat ended
video_chat_participants_invitedVideoChatParticipantsInvitedOptionalService message: new participants invited to a video chat
web_app_dataWebAppDataOptionalService message: data sent by a Web App
reply_markupInlineKeyboardMarkupOptionalInline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Botlify Cloud Runtime
Credentials are auto-injected in .env — always load them with getenv(): BOT_TOKEN, ADMIN_CHAT_ID, BOT_USERNAME. Main database: database.db (SQLite, WAL mode). Runtime errors: error.log. Quick test: send to $ADMIN_CHAT_ID. Full details: Runtime Reference.