class Message

This object represents a message.

Methods

__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

int
getMessageId()

Unique message identifier inside this chat.

int
getDate()

Date the message was sent in Unix time.

getChat()

Conversation the message belongs to.

int|null
getMessageThreadId()

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.

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.

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.

User|null
getForwardFrom()

Optional. For forwarded messages, sender of the original message.

Chat|null
getForwardFromChat()

Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.

int|null
getForwardFromMessageId()

Optional. For messages forwarded from channels, identifier of the original message in the channel.

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.

string|null
getForwardSenderName()

Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.

int|null
getForwardDate()

Optional. For forwarded messages, date the original message was sent in Unix time.

bool|null
getIsTopicMessage()

Optional. True, if the message is sent to a forum topic.

bool|null
getIsAutomaticForward()

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.

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.

User|null
getViaBot()

Optional. Bot through which the message was sent.

int|null
getEditDate()

Optional. Date the message was last edited in Unix time.

bool|null
getHasProtectedContent()

Optional. True, if the message can't be forwarded.

string|null
getMediaGroupId()

Optional. The unique identifier of a media message group this message belongs to.

string|null
getAuthorSignature()

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.

string|null
getText()

Optional. For text messages, the actual UTF-8 text of the message.

array|null
getEntities()

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.

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.

Audio|null
getAudio()

Optional. Message is an audio file, information about the file.

Document|null
getDocument()

Optional. Message is a general file, information about the file.

array|null
getPhoto()

Optional. Message is a photo, available sizes of the photo.

Sticker|null
getSticker()

Optional. Message is a sticker, information about the sticker.

Video|null
getVideo()

Optional. Message is a video, information about the video.

VideoNote|null
getVideoNote()

Optional. Message is a video note, information about the video message.

Voice|null
getVoice()

Optional. Message is a voice message, information about the file.

string|null
getCaption()

Optional. Caption for the animation, audio, document, photo, video or voice.

array|null
getCaptionEntities()

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.

Contact|null
getContact()

Optional. Message is a shared contact, information about the contact.

Dice|null
getDice()

Optional. Message is a dice with random value.

Game|null
getGame()

Optional. Message is a game, information about the game. More about games ».

Poll|null
getPoll()

Optional. Message is a native poll, information about the poll.

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.

Location|null
getLocation()

Optional. Message is a shared location, information about the location.

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).

User|null
getLeftChatMember()

Optional. A member was removed from the group, information about them (this member may be the bot itself).

string|null
getNewChatTitle()

Optional. A chat title was changed to this value.

array|null
getNewChatPhoto()

Optional. A chat photo was change to this value.

bool|null
getDeleteChatPhoto()

Optional. Service message: the chat photo was deleted.

bool|null
getGroupChatCreated()

Optional. Service message: the group has been created.

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.

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.

MessageAutoDeleteTimerChanged|null
getMessageAutoDeleteTimerChanged()

Optional. Service message: auto-delete timer settings changed in the chat.

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.

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.

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.

Invoice|null
getInvoice()

Optional. Message is an invoice for a payment, information about the invoice. More about payments ».

SuccessfulPayment|null
getSuccessfulPayment()

Optional. Message is a service message about a successful payment, information about the payment. More about payments ».

string|null
getConnectedWebsite()

Optional. The domain name of the website on which the user has logged in. More about Telegram Login ».

PassportData|null
getPassportData()

Optional. Telegram Passport data.

ProximityAlertTriggered|null
getProximityAlertTriggered()

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

ForumTopicCreated|null
getForumTopicCreated()

Optional. Service message: forum topic created.

ForumTopicClosedInterface|null
getForumTopicClosed()

Optional. Service message: forum topic closed.

ForumTopicReopenedInterface|null
getForumTopicReopened()

Optional. Service message: forum topic reopened.

VideoChatScheduled|null
getVideoChatScheduled()

Optional. Service message: video chat scheduled.

VideoChatStartedInterface|null
getVideoChatStarted()

Optional. Service message: video chat started.

VideoChatEnded|null
getVideoChatEnded()

Optional. Service message: video chat ended.

VideoChatParticipantsInvited|null
getVideoChatParticipantsInvited()

Optional. Service message: new participants invited to a video chat.

WebAppData|null
getWebAppData()

Optional. Service message: data sent by a Web App.

InlineKeyboardMarkup|null
getReplyMarkup()

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

Parameters

int $message_id
int $date
Chat $chat
int|null $message_thread_id
User|null $from
Chat|null $sender_chat
User|null $forward_from
Chat|null $forward_from_chat
int|null $forward_from_message_id
string|null $forward_signature
string|null $forward_sender_name
int|null $forward_date
bool|null $is_topic_message
bool|null $is_automatic_forward
Message|null $reply_to_message
User|null $via_bot
int|null $edit_date
bool|null $has_protected_content
string|null $media_group_id
string|null $author_signature
string|null $text
MessageEntity[]|null $entities
Animation|null $animation
Audio|null $audio
Document|null $document
PhotoSize[]|null $photo
Sticker|null $sticker
Video|null $video
VideoNote|null $video_note
Voice|null $voice
string|null $caption
MessageEntity[]|null $caption_entities
Contact|null $contact
Dice|null $dice
Game|null $game
Poll|null $poll
Venue|null $venue
Location|null $location
User[]|null $new_chat_members
User|null $left_chat_member
string|null $new_chat_title
PhotoSize[]|null $new_chat_photo
bool|null $delete_chat_photo
bool|null $group_chat_created
bool|null $supergroup_chat_created
bool|null $channel_chat_created
MessageAutoDeleteTimerChanged|null $message_auto_delete_timer_changed
int|null $migrate_to_chat_id
int|null $migrate_from_chat_id
Message|null $pinned_message
Invoice|null $invoice
SuccessfulPayment|null $successful_payment
string|null $connected_website
PassportData|null $passport_data
ProximityAlertTriggered|null $proximity_alert_triggered
ForumTopicCreated|null $forum_topic_created
ForumTopicClosedInterface|null $forum_topic_closed
ForumTopicReopenedInterface|null $forum_topic_reopened
VideoChatScheduled|null $video_chat_scheduled
VideoChatStartedInterface|null $video_chat_started
VideoChatEnded|null $video_chat_ended
VideoChatParticipantsInvited|null $video_chat_participants_invited
WebAppData|null $web_app_data
InlineKeyboardMarkup|null $reply_markup

at line 147
int getMessageId()

Unique message identifier inside this chat.

Return Value

int

at line 155
int getDate()

Date the message was sent in Unix time.

Return Value

int

at line 163
Chat getChat()

Conversation the message belongs to.

Return Value

Chat

at line 171
int|null getMessageThreadId()

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only.

Return Value

int|null

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.

Return Value

User|null

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.

Return Value

Chat|null

at line 195
User|null getForwardFrom()

Optional. For forwarded messages, sender of the original message.

Return Value

User|null

at line 203
Chat|null getForwardFromChat()

Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.

Return Value

Chat|null

at line 211
int|null getForwardFromMessageId()

Optional. For messages forwarded from channels, identifier of the original message in the channel.

Return Value

int|null

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.

Return Value

string|null

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.

Return Value

string|null

at line 235
int|null getForwardDate()

Optional. For forwarded messages, date the original message was sent in Unix time.

Return Value

int|null

at line 243
bool|null getIsTopicMessage()

Optional. True, if the message is sent to a forum topic.

Return Value

bool|null

at line 251
bool|null getIsAutomaticForward()

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group.

Return Value

bool|null

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.

Return Value

Message|null

at line 267
User|null getViaBot()

Optional. Bot through which the message was sent.

Return Value

User|null

at line 275
int|null getEditDate()

Optional. Date the message was last edited in Unix time.

Return Value

int|null

at line 283
bool|null getHasProtectedContent()

Optional. True, if the message can't be forwarded.

Return Value

bool|null

at line 291
string|null getMediaGroupId()

Optional. The unique identifier of a media message group this message belongs to.

Return Value

string|null

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.

Return Value

string|null

at line 307
string|null getText()

Optional. For text messages, the actual UTF-8 text of the message.

Return Value

string|null

at line 317
array|null getEntities()

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.

Return Value

array|null

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.

Return Value

Animation|null

at line 333
Audio|null getAudio()

Optional. Message is an audio file, information about the file.

Return Value

Audio|null

at line 341
Document|null getDocument()

Optional. Message is a general file, information about the file.

Return Value

Document|null

at line 351
array|null getPhoto()

Optional. Message is a photo, available sizes of the photo.

Return Value

array|null

at line 359
Sticker|null getSticker()

Optional. Message is a sticker, information about the sticker.

Return Value

Sticker|null

at line 367
Video|null getVideo()

Optional. Message is a video, information about the video.

Return Value

Video|null

at line 375
VideoNote|null getVideoNote()

Optional. Message is a video note, information about the video message.

Return Value

VideoNote|null

at line 383
Voice|null getVoice()

Optional. Message is a voice message, information about the file.

Return Value

Voice|null

at line 391
string|null getCaption()

Optional. Caption for the animation, audio, document, photo, video or voice.

Return Value

string|null

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.

Return Value

array|null

at line 409
Contact|null getContact()

Optional. Message is a shared contact, information about the contact.

Return Value

Contact|null

at line 417
Dice|null getDice()

Optional. Message is a dice with random value.

Return Value

Dice|null

at line 425
Game|null getGame()

Optional. Message is a game, information about the game. More about games ».

Return Value

Game|null

at line 433
Poll|null getPoll()

Optional. Message is a native poll, information about the poll.

Return Value

Poll|null

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.

Return Value

Venue|null

at line 449
Location|null getLocation()

Optional. Message is a shared location, information about the location.

Return Value

Location|null

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).

Return Value

array|null

at line 467
User|null getLeftChatMember()

Optional. A member was removed from the group, information about them (this member may be the bot itself).

Return Value

User|null

at line 475
string|null getNewChatTitle()

Optional. A chat title was changed to this value.

Return Value

string|null

at line 485
array|null getNewChatPhoto()

Optional. A chat photo was change to this value.

Return Value

array|null

at line 493
bool|null getDeleteChatPhoto()

Optional. Service message: the chat photo was deleted.

Return Value

bool|null

at line 501
bool|null getGroupChatCreated()

Optional. Service message: the group has been created.

Return Value

bool|null

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.

Return Value

bool|null

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.

Return Value

bool|null

at line 525
MessageAutoDeleteTimerChanged|null getMessageAutoDeleteTimerChanged()

Optional. Service message: auto-delete timer settings changed in the chat.

Return Value

MessageAutoDeleteTimerChanged|null

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.

Return Value

int|null

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.

Return Value

int|null

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.

Return Value

Message|null

at line 557
Invoice|null getInvoice()

Optional. Message is an invoice for a payment, information about the invoice. More about payments ».

Return Value

Invoice|null

at line 565
SuccessfulPayment|null getSuccessfulPayment()

Optional. Message is a service message about a successful payment, information about the payment. More about payments ».

Return Value

SuccessfulPayment|null

at line 573
string|null getConnectedWebsite()

Optional. The domain name of the website on which the user has logged in. More about Telegram Login ».

Return Value

string|null

at line 581
PassportData|null getPassportData()

Optional. Telegram Passport data.

Return Value

PassportData|null

at line 589
ProximityAlertTriggered|null getProximityAlertTriggered()

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

Return Value

ProximityAlertTriggered|null

at line 597
ForumTopicCreated|null getForumTopicCreated()

Optional. Service message: forum topic created.

Return Value

ForumTopicCreated|null

at line 605
ForumTopicClosedInterface|null getForumTopicClosed()

Optional. Service message: forum topic closed.

Return Value

ForumTopicClosedInterface|null

at line 613
ForumTopicReopenedInterface|null getForumTopicReopened()

Optional. Service message: forum topic reopened.

Return Value

ForumTopicReopenedInterface|null

at line 621
VideoChatScheduled|null getVideoChatScheduled()

Optional. Service message: video chat scheduled.

Return Value

VideoChatScheduled|null

at line 629
VideoChatStartedInterface|null getVideoChatStarted()

Optional. Service message: video chat started.

Return Value

VideoChatStartedInterface|null

at line 637
VideoChatEnded|null getVideoChatEnded()

Optional. Service message: video chat ended.

Return Value

VideoChatEnded|null

at line 645
VideoChatParticipantsInvited|null getVideoChatParticipantsInvited()

Optional. Service message: new participants invited to a video chat.

Return Value

VideoChatParticipantsInvited|null

at line 653
WebAppData|null getWebAppData()

Optional. Service message: data sent by a Web App.

Return Value

WebAppData|null

at line 661
InlineKeyboardMarkup|null getReplyMarkup()

Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

Return Value

InlineKeyboardMarkup|null