class Message extends BaseObject (View source)

Class Message.

Methods

__construct( array|mixed $data)

Builds collection entity.

from  BaseObject
array
relations()

Property relations.

mixed|BaseObject
get( mixed $key, mixed $default = null)

Get an item from the collection by key.

from  BaseObject
array|void
mapRelatives()

Map property relatives to appropriate objects.

from  BaseObject
array|mixed
getRawResponse()

Returns raw response.

from  BaseObject
mixed
getRawResult($data)

Returns raw result.

from  BaseObject
mixed
getStatus()

Get Status of request.

from  BaseObject
mixed
__call($name, $arguments)

Magic method to get properties dynamically.

from  BaseObject
int
getMessageId()

Unique message identifier.

User
getFrom()

(Optional). Sender, can be empty for messages sent to channels.

int
getDate()

Date the message was sent in Unix time.

Chat
getChat()

Conversation the message belongs to.

User
getForwardFrom()

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

int
getForwardDate()

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

Message
getReplyToMessage()

(Optional). For replies, the original message. Note that the Message object in this field will not contain further replytomessage fields even if it itself is a reply.

string
getText()

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

Audio
getAudio()

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

Document
getDocument()

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

Sticker
getSticker()

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

Video
getVideo()

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

Voice
getVoice()

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

string
getCaption()

(Optional). Caption for the photo or video contact.

Contact
getContact()

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

Location
getLocation()

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

User
getNewChatParticipant()

(Optional). A new member was added to the group, information about them (this member may be the bot itself).

User
getLeftChatParticipant()

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

string
getNewChatTitle()

(Optional). A chat title was changed to this value.

bool
getDeleteChatPhoto()

(Optional). Service message: the chat photo was deleted.

bool
getGroupChatCreated()

(Optional). Service message: the group has been created.

bool
getSupergroupChatCreated()

(Optional). Service message: the super group has been created.

bool
getChannelChatCreated()

(Optional). Service message: the channel has been created.

int
getMigrateToChatId()

(Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value.

int
getMigrateFromChatId()

(Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value.

Details

in BaseObject at line 17
__construct( array|mixed $data)

Builds collection entity.

Parameters

array|mixed $data

at line 42
array relations()

Property relations.

Return Value

array

in BaseObject at line 39
mixed|BaseObject get( mixed $key, mixed $default = null)

Get an item from the collection by key.

Parameters

mixed $key
mixed $default

Return Value

mixed|BaseObject

in BaseObject at line 53
array|void mapRelatives()

Map property relatives to appropriate objects.

Return Value

array|void

in BaseObject at line 83
array|mixed getRawResponse()

Returns raw response.

Return Value

array|mixed

in BaseObject at line 95
mixed getRawResult($data)

Returns raw result.

Parameters

$data

Return Value

mixed

in BaseObject at line 105
mixed getStatus()

Get Status of request.

Return Value

mixed

in BaseObject at line 118
mixed __call($name, $arguments)

Magic method to get properties dynamically.

Parameters

$name
$arguments

Return Value

mixed

at line 37
int getMessageId()

Unique message identifier.

Return Value

int

at line 37
User getFrom()

(Optional). Sender, can be empty for messages sent to channels.

Return Value

User

at line 37
int getDate()

Date the message was sent in Unix time.

Return Value

int

at line 37
Chat getChat()

Conversation the message belongs to.

Return Value

Chat

at line 37
User getForwardFrom()

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

Return Value

User

at line 37
int getForwardDate()

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

Return Value

int

at line 37
Message getReplyToMessage()

(Optional). For replies, the original message. Note that the Message object in this field will not contain further replytomessage fields even if it itself is a reply.

Return Value

Message

at line 37
string getText()

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

Return Value

string

at line 37
Audio getAudio()

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

Return Value

Audio

at line 37
Document getDocument()

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

Return Value

Document

at line 37
Sticker getSticker()

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

Return Value

Sticker

at line 37
Video getVideo()

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

Return Value

Video

at line 37
Voice getVoice()

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

Return Value

Voice

at line 37
string getCaption()

(Optional). Caption for the photo or video contact.

Return Value

string

at line 37
Contact getContact()

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

Return Value

Contact

at line 37
Location getLocation()

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

Return Value

Location

at line 37
User getNewChatParticipant()

(Optional). A new member was added to the group, information about them (this member may be the bot itself).

Return Value

User

at line 37
User getLeftChatParticipant()

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

Return Value

User

at line 37
string getNewChatTitle()

(Optional). A chat title was changed to this value.

Return Value

string

at line 37
bool getDeleteChatPhoto()

(Optional). Service message: the chat photo was deleted.

Return Value

bool

at line 37
bool getGroupChatCreated()

(Optional). Service message: the group has been created.

Return Value

bool

at line 37
bool getSupergroupChatCreated()

(Optional). Service message: the super group has been created.

Return Value

bool

at line 37
bool getChannelChatCreated()

(Optional). Service message: the channel has been created.

Return Value

bool

at line 37
int getMigrateToChatId()

(Optional). The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value.

Return Value

int

at line 37
int getMigrateFromChatId()

(Optional). The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value.

Return Value

int