Message
class Message
This object represents a message.
Methods
No description
Unique message identifier inside this chat.
Date the message was sent in Unix time.
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.
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, 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. 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, identifier of the original message in the channel.
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's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
Optional. For forwarded messages, date the original message was sent in Unix time.
Optional. True, if the message is sent to a forum topic.
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.
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. Bot through which the message was sent.
Optional. Date the message was last edited in Unix time.
Optional. True, if the message can't be forwarded.
Optional. The unique identifier of a media message group this message belongs to.
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
Optional. For text messages, the actual UTF-8 text of the message.
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
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 a general file, information about the file.
Optional. Message is a photo, available sizes of the photo.
Optional. Message is a sticker, information about the sticker.
Optional. Message is a video, information about the video.
Optional. Message is a video note, information about the video message.
Optional. Message is a voice message, information about the file.
Optional. Caption for the animation, audio, document, photo, video or voice.
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
Optional. Message is a shared contact, information about the contact.
Optional. Message is a dice with random value.
Optional. Message is a game, information about the game. More about games ».
Optional. Message is a native poll, information about the poll.
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 shared location, information about the location.
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 member was removed from the group, information about them (this member may be the bot itself).
Optional. A chat title was changed to this value.
Optional. A chat photo was change to this value.
Optional. Service message: the chat photo was deleted.
Optional. Service message: the group has been created.
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 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: auto-delete timer settings changed in the chat.
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 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. 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 an invoice for a payment, information about the invoice. More about payments ».
Optional. Message is a service message about a successful payment, information about the payment. More about payments ».
Optional. The domain name of the website on which the user has logged in. More about Telegram Login ».
Optional. Telegram Passport data.
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
Optional. Service message: forum topic created.
Optional. Service message: forum topic closed.
Optional. Service message: forum topic reopened.
Optional. Service message: video chat scheduled.
Optional. Service message: video chat started.
Optional. Service message: video chat ended.
Optional. Service message: new participants invited to a video chat.
Optional. Service message: data sent by a Web App.
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
Details
at line 76
__construct(int $message_id, int $date, Chat $chat, int|null $message_thread_id = null, User|null $from = null, Chat|null $sender_chat = null, User|null $forward_from = null, Chat|null $forward_from_chat = null, int|null $forward_from_message_id = null, string|null $forward_signature = null, string|null $forward_sender_name = null, int|null $forward_date = null, bool|null $is_topic_message = null, bool|null $is_automatic_forward = null, Message|null $reply_to_message = null, User|null $via_bot = null, int|null $edit_date = null, bool|null $has_protected_content = null, string|null $media_group_id = null, string|null $author_signature = null, string|null $text = null, MessageEntity[]|null $entities = null, Animation|null $animation = null, Audio|null $audio = null, Document|null $document = null, PhotoSize[]|null $photo = null, Sticker|null $sticker = null, Video|null $video = null, VideoNote|null $video_note = null, Voice|null $voice = null, string|null $caption = null, MessageEntity[]|null $caption_entities = null, Contact|null $contact = null, Dice|null $dice = null, Game|null $game = null, Poll|null $poll = null, Venue|null $venue = null, Location|null $location = null, User[]|null $new_chat_members = null, User|null $left_chat_member = null, string|null $new_chat_title = null, PhotoSize[]|null $new_chat_photo = null, bool|null $delete_chat_photo = null, bool|null $group_chat_created = null, bool|null $supergroup_chat_created = null, bool|null $channel_chat_created = null, MessageAutoDeleteTimerChanged|null $message_auto_delete_timer_changed = null, int|null $migrate_to_chat_id = null, int|null $migrate_from_chat_id = null, Message|null $pinned_message = null, Invoice|null $invoice = null, SuccessfulPayment|null $successful_payment = null, string|null $connected_website = null, PassportData|null $passport_data = null, ProximityAlertTriggered|null $proximity_alert_triggered = null, ForumTopicCreated|null $forum_topic_created = null, ForumTopicClosedInterface|null $forum_topic_closed = null, ForumTopicReopenedInterface|null $forum_topic_reopened = null, VideoChatScheduled|null $video_chat_scheduled = null, VideoChatStartedInterface|null $video_chat_started = null, VideoChatEnded|null $video_chat_ended = null, VideoChatParticipantsInvited|null $video_chat_participants_invited = null, WebAppData|null $web_app_data = null, InlineKeyboardMarkup|null $reply_markup = null)
No description
at line 147
int
getMessageId()
Unique message identifier inside this chat.
at line 155
int
getDate()
Date the message was sent in Unix time.
at line 163
Chat
getChat()
Conversation the message belongs to.
at line 171
int|null
getMessageThreadId()
Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.
at line 179
User|null
getFrom()
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.
at line 187
Chat|null
getSenderChat()
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.
at line 195
User|null
getForwardFrom()
Optional. For forwarded messages, sender of the original message.
at line 203
Chat|null
getForwardFromChat()
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.
at line 211
int|null
getForwardFromMessageId()
Optional. For messages forwarded from channels, identifier of the original message in the channel.
at line 219
string|null
getForwardSignature()
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present.
at line 227
string|null
getForwardSenderName()
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
at line 235
int|null
getForwardDate()
Optional. For forwarded messages, date the original message was sent in Unix time.
at line 243
bool|null
getIsTopicMessage()
Optional. True, if the message is sent to a forum topic.
at line 251
bool|null
getIsAutomaticForward()
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.
at line 259
Message|null
getReplyToMessage()
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.
at line 267
User|null
getViaBot()
Optional. Bot through which the message was sent.
at line 275
int|null
getEditDate()
Optional. Date the message was last edited in Unix time.
at line 283
bool|null
getHasProtectedContent()
Optional. True, if the message can't be forwarded.
at line 291
string|null
getMediaGroupId()
Optional. The unique identifier of a media message group this message belongs to.
at line 299
string|null
getAuthorSignature()
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
at line 307
string|null
getText()
Optional. For text messages, the actual UTF-8 text of the message.
at line 317
array|null
getEntities()
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
at line 325
Animation|null
getAnimation()
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
at line 333
Audio|null
getAudio()
Optional. Message is an audio file, information about the file.
at line 341
Document|null
getDocument()
Optional. Message is a general file, information about the file.
at line 351
array|null
getPhoto()
Optional. Message is a photo, available sizes of the photo.
at line 359
Sticker|null
getSticker()
Optional. Message is a sticker, information about the sticker.
at line 367
Video|null
getVideo()
Optional. Message is a video, information about the video.
at line 375
VideoNote|null
getVideoNote()
Optional. Message is a video note, information about the video message.
at line 383
Voice|null
getVoice()
Optional. Message is a voice message, information about the file.
at line 391
string|null
getCaption()
Optional. Caption for the animation, audio, document, photo, video or voice.
at line 401
array|null
getCaptionEntities()
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
at line 409
Contact|null
getContact()
Optional. Message is a shared contact, information about the contact.
at line 417
Dice|null
getDice()
Optional. Message is a dice with random value.
at line 425
Game|null
getGame()
Optional. Message is a game, information about the game. More about games ».
at line 433
Poll|null
getPoll()
Optional. Message is a native poll, information about the poll.
at line 441
Venue|null
getVenue()
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
at line 449
Location|null
getLocation()
Optional. Message is a shared location, information about the location.
at line 459
array|null
getNewChatMembers()
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members).
at line 467
User|null
getLeftChatMember()
Optional. A member was removed from the group, information about them (this member may be the bot itself).
at line 475
string|null
getNewChatTitle()
Optional. A chat title was changed to this value.
at line 485
array|null
getNewChatPhoto()
Optional. A chat photo was change to this value.
at line 493
bool|null
getDeleteChatPhoto()
Optional. Service message: the chat photo was deleted.
at line 501
bool|null
getGroupChatCreated()
Optional. Service message: the group has been created.
at line 509
bool|null
getSupergroupChatCreated()
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.
at line 517
bool|null
getChannelChatCreated()
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.
at line 525
MessageAutoDeleteTimerChanged|null
getMessageAutoDeleteTimerChanged()
Optional. Service message: auto-delete timer settings changed in the chat.
at line 533
int|null
getMigrateToChatId()
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.
at line 541
int|null
getMigrateFromChatId()
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.
at line 549
Message|null
getPinnedMessage()
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.
at line 557
Invoice|null
getInvoice()
Optional. Message is an invoice for a payment, information about the invoice. More about payments ».
at line 565
SuccessfulPayment|null
getSuccessfulPayment()
Optional. Message is a service message about a successful payment, information about the payment. More about payments ».
at line 573
string|null
getConnectedWebsite()
Optional. The domain name of the website on which the user has logged in. More about Telegram Login ».
at line 581
PassportData|null
getPassportData()
Optional. Telegram Passport data.
at line 589
ProximityAlertTriggered|null
getProximityAlertTriggered()
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
at line 597
ForumTopicCreated|null
getForumTopicCreated()
Optional. Service message: forum topic created.
at line 605
ForumTopicClosedInterface|null
getForumTopicClosed()
Optional. Service message: forum topic closed.
at line 613
ForumTopicReopenedInterface|null
getForumTopicReopened()
Optional. Service message: forum topic reopened.
at line 621
VideoChatScheduled|null
getVideoChatScheduled()
Optional. Service message: video chat scheduled.
at line 629
VideoChatStartedInterface|null
getVideoChatStarted()
Optional. Service message: video chat started.
at line 637
VideoChatEnded|null
getVideoChatEnded()
Optional. Service message: video chat ended.
at line 645
VideoChatParticipantsInvited|null
getVideoChatParticipantsInvited()
Optional. Service message: new participants invited to a video chat.
at line 653
WebAppData|null
getWebAppData()
Optional. Service message: data sent by a Web App.
at line 661
InlineKeyboardMarkup|null
getReplyMarkup()
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.