PHP Class TelegramBot\Api\Types\Message

Inheritance: extends TelegramBot\Api\BaseType, implements TelegramBot\Api\TypeInterface
Show file Open project: TelegramBot/Api Class Usage Examples

Protected Properties

Property Type Description
$audio TelegramBot\Api\Types\Audio Optional. Message is an audio file, information about the file
$caption string Optional. Text description of the video (usually empty)
$channelChatCreated boolean Optional. Service message: the channel has been created
$chat Chat Conversation the message belongs to — user in case of a private message, GroupChat in case of a group
$contact TelegramBot\Api\Types\Contact Optional. Message is a shared contact, information about the contact
$date integer Date the message was sent in Unix time
$deleteChatPhoto boolean Optional. Informs that the group photo was deleted
$document TelegramBot\Api\Types\Document Optional. Message is a general file, information about the file
$entities array array of \TelegramBot\Api\Types\MessageEntity
$forwardDate integer Optional. For forwarded messages, date the original message was sent in Unix time
$forwardFrom User Optional. For forwarded messages, sender of the original message
$from User Optional. Sender name. Can be empty for messages sent to channels
$groupChatCreated boolean Optional. Informs that the group has been created
$leftChatMember User Optional. A member was removed from the group, information about them (this member may be bot itself)
$location TelegramBot\Api\Types\Location Optional. Message is a shared location, information about the location
$map array
$messageId integer Unique message identifier
$migrateFromChatId integer Optional. The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value
$migrateToChatId integer Optional. The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value
$newChatMember User Optional. A new member was added to the group, information about them (this member may be bot itself)
$newChatPhoto mixed Optional. A group photo was change to this value
$newChatTitle string Optional. A group title was changed to this value
$photo array Optional. Message is a photo, available sizes of the photo array of \TelegramBot\Api\Types\Photo
$pinnedMessage Message 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.
$replyToMessage Message 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.
$requiredParams array
$sticker TelegramBot\Api\Types\Sticker Optional. Message is a sticker, information about the sticker
$supergroupChatCreated boolean Optional. Service message: the supergroup has been created
$text string Optional. For text messages, the actual UTF-8 text of the message
$venue Venue Optional. Message is a venue, information about the venue
$video TelegramBot\Api\Types\Video Optional. Message is a video, information about the video
$voice TelegramBot\Api\Types\Voice Optional. Message is a voice message, information about the file

Public Methods

Method Description
getAudio ( ) : TelegramBot\Api\Types\Audio
getCaption ( ) : string
getChat ( ) : Chat
getContact ( ) : TelegramBot\Api\Types\Contact
getDate ( ) : integer
getDocument ( ) : TelegramBot\Api\Types\Document
getEntities ( ) : array
getForwardDate ( ) : integer
getForwardFrom ( ) : User
getFrom ( ) : User
getLeftChatMember ( ) : User
getLocation ( ) : TelegramBot\Api\Types\Location
getMessageId ( ) : integer
getMigrateFromChatId ( ) : integer
getMigrateToChatId ( ) : integer
getNewChatMember ( ) : User
getNewChatPhoto ( ) : array
getNewChatTitle ( ) : string
getPhoto ( ) : array
getPinnedMessage ( ) : Message
getReplyToMessage ( ) : Message
getSticker ( ) : TelegramBot\Api\Types\Sticker
getText ( ) : string
getVenue ( ) : Venue
getVideo ( ) : TelegramBot\Api\Types\Video
getVoice ( ) : TelegramBot\Api\Types\Voice
isChannelChatCreated ( ) : boolean
isDeleteChatPhoto ( ) : boolean
isGroupChatCreated ( ) : boolean
isSupergroupChatCreated ( ) : boolean
setAudio ( TelegramBot\Api\Types\Audio $audio )
setCaption ( string $caption )
setChannelChatCreated ( boolean $channelChatCreated )
setChat ( Chat $chat )
setContact ( TelegramBot\Api\Types\Contact $contact )
setDate ( integer $date )
setDeleteChatPhoto ( boolean $deleteChatPhoto )
setDocument ( TelegramBot\Api\Types\Document $document )
setEntities ( array $entities )
setForwardDate ( integer $forwardDate )
setForwardFrom ( User $forwardFrom )
setFrom ( User $from )
setGroupChatCreated ( boolean $groupChatCreated )
setLeftChatMember ( User $leftChatMember )
setLocation ( TelegramBot\Api\Types\Location $location )
setMessageId ( integer $messageId )
setMigrateFromChatId ( integer $migrateFromChatId )
setMigrateToChatId ( integer $migrateToChatId )
setNewChatMember ( User $newChatMember )
setNewChatPhoto ( array $newChatPhoto )
setNewChatTitle ( string $newChatTitle )
setPhoto ( array $photo )
setPinnedMessage ( Message $pinnedMessage )
setReplyToMessage ( Message $replyToMessage )
setSticker ( TelegramBot\Api\Types\Sticker $sticker )
setSupergroupChatCreated ( boolean $supergroupChatCreated )
setText ( string $text )
setVenue ( Venue $venue )
setVideo ( TelegramBot\Api\Types\Video $video )
setVoice ( TelegramBot\Api\Types\Voice $voice )

Method Details

getAudio() public method

public getAudio ( ) : TelegramBot\Api\Types\Audio
return TelegramBot\Api\Types\Audio

getCaption() public method

public getCaption ( ) : string
return string

getChat() public method

public getChat ( ) : Chat
return Chat

getContact() public method

public getContact ( ) : TelegramBot\Api\Types\Contact
return TelegramBot\Api\Types\Contact

getDate() public method

public getDate ( ) : integer
return integer

getDocument() public method

public getDocument ( ) : TelegramBot\Api\Types\Document
return TelegramBot\Api\Types\Document

getEntities() public method

public getEntities ( ) : array
return array

getForwardDate() public method

public getForwardDate ( ) : integer
return integer

getForwardFrom() public method

public getForwardFrom ( ) : User
return User

getFrom() public method

public getFrom ( ) : User
return User

getLeftChatMember() public method

public getLeftChatMember ( ) : User
return User

getLocation() public method

public getLocation ( ) : TelegramBot\Api\Types\Location
return TelegramBot\Api\Types\Location

getMessageId() public method

public getMessageId ( ) : integer
return integer

getMigrateFromChatId() public method

public getMigrateFromChatId ( ) : integer
return integer

getMigrateToChatId() public method

public getMigrateToChatId ( ) : integer
return integer

getNewChatMember() public method

public getNewChatMember ( ) : User
return User

getNewChatPhoto() public method

public getNewChatPhoto ( ) : array
return array

getNewChatTitle() public method

public getNewChatTitle ( ) : string
return string

getPhoto() public method

public getPhoto ( ) : array
return array

getPinnedMessage() public method

public getPinnedMessage ( ) : Message
return Message

getReplyToMessage() public method

public getReplyToMessage ( ) : Message
return Message

getSticker() public method

public getSticker ( ) : TelegramBot\Api\Types\Sticker
return TelegramBot\Api\Types\Sticker

getText() public method

public getText ( ) : string
return string

getVenue() public method

public getVenue ( ) : Venue
return Venue

getVideo() public method

public getVideo ( ) : TelegramBot\Api\Types\Video
return TelegramBot\Api\Types\Video

getVoice() public method

public getVoice ( ) : TelegramBot\Api\Types\Voice
return TelegramBot\Api\Types\Voice

isChannelChatCreated() public method

public isChannelChatCreated ( ) : boolean
return boolean

isDeleteChatPhoto() public method

public isDeleteChatPhoto ( ) : boolean
return boolean

isGroupChatCreated() public method

public isGroupChatCreated ( ) : boolean
return boolean

isSupergroupChatCreated() public method

setAudio() public method

public setAudio ( TelegramBot\Api\Types\Audio $audio )
$audio TelegramBot\Api\Types\Audio

setCaption() public method

public setCaption ( string $caption )
$caption string

setChannelChatCreated() public method

public setChannelChatCreated ( boolean $channelChatCreated )
$channelChatCreated boolean

setChat() public method

public setChat ( Chat $chat )
$chat Chat

setContact() public method

public setContact ( TelegramBot\Api\Types\Contact $contact )
$contact TelegramBot\Api\Types\Contact

setDate() public method

public setDate ( integer $date )
$date integer

setDeleteChatPhoto() public method

public setDeleteChatPhoto ( boolean $deleteChatPhoto )
$deleteChatPhoto boolean

setDocument() public method

public setDocument ( TelegramBot\Api\Types\Document $document )
$document TelegramBot\Api\Types\Document

setEntities() public method

public setEntities ( array $entities )
$entities array

setForwardDate() public method

public setForwardDate ( integer $forwardDate )
$forwardDate integer

setForwardFrom() public method

public setForwardFrom ( User $forwardFrom )
$forwardFrom User

setFrom() public method

public setFrom ( User $from )
$from User

setGroupChatCreated() public method

public setGroupChatCreated ( boolean $groupChatCreated )
$groupChatCreated boolean

setLeftChatMember() public method

public setLeftChatMember ( User $leftChatMember )
$leftChatMember User

setLocation() public method

public setLocation ( TelegramBot\Api\Types\Location $location )
$location TelegramBot\Api\Types\Location

setMessageId() public method

public setMessageId ( integer $messageId )
$messageId integer

setMigrateFromChatId() public method

public setMigrateFromChatId ( integer $migrateFromChatId )
$migrateFromChatId integer

setMigrateToChatId() public method

public setMigrateToChatId ( integer $migrateToChatId )
$migrateToChatId integer

setNewChatMember() public method

public setNewChatMember ( User $newChatMember )
$newChatMember User

setNewChatPhoto() public method

public setNewChatPhoto ( array $newChatPhoto )
$newChatPhoto array

setNewChatTitle() public method

public setNewChatTitle ( string $newChatTitle )
$newChatTitle string

setPhoto() public method

public setPhoto ( array $photo )
$photo array

setPinnedMessage() public method

public setPinnedMessage ( Message $pinnedMessage )
$pinnedMessage Message

setReplyToMessage() public method

public setReplyToMessage ( Message $replyToMessage )
$replyToMessage Message

setSticker() public method

public setSticker ( TelegramBot\Api\Types\Sticker $sticker )
$sticker TelegramBot\Api\Types\Sticker

setSupergroupChatCreated() public method

public setSupergroupChatCreated ( boolean $supergroupChatCreated )
$supergroupChatCreated boolean

setText() public method

public setText ( string $text )
$text string

setVenue() public method

public setVenue ( Venue $venue )
$venue Venue

setVideo() public method

public setVideo ( TelegramBot\Api\Types\Video $video )
$video TelegramBot\Api\Types\Video

setVoice() public method

public setVoice ( TelegramBot\Api\Types\Voice $voice )
$voice TelegramBot\Api\Types\Voice

Property Details

$audio protected property

Optional. Message is an audio file, information about the file
protected Audio,TelegramBot\Api\Types $audio
return TelegramBot\Api\Types\Audio

$caption protected property

Optional. Text description of the video (usually empty)
protected string $caption
return string

$channelChatCreated protected property

Optional. Service message: the channel has been created
protected bool $channelChatCreated
return boolean

$chat protected property

Conversation the message belongs to — user in case of a private message, GroupChat in case of a group
protected Chat,TelegramBot\Api\Types $chat
return Chat

$contact protected property

Optional. Message is a shared contact, information about the contact
protected Contact,TelegramBot\Api\Types $contact
return TelegramBot\Api\Types\Contact

$date protected property

Date the message was sent in Unix time
protected int $date
return integer

$deleteChatPhoto protected property

Optional. Informs that the group photo was deleted
protected bool $deleteChatPhoto
return boolean

$document protected property

Optional. Message is a general file, information about the file
protected Document,TelegramBot\Api\Types $document
return TelegramBot\Api\Types\Document

$entities protected property

array of \TelegramBot\Api\Types\MessageEntity
protected array $entities
return array

$forwardDate protected property

Optional. For forwarded messages, date the original message was sent in Unix time
protected int $forwardDate
return integer

$forwardFrom protected property

Optional. For forwarded messages, sender of the original message
protected User,TelegramBot\Api\Types $forwardFrom
return User

$from protected property

Optional. Sender name. Can be empty for messages sent to channels
protected User,TelegramBot\Api\Types $from
return User

$groupChatCreated protected property

Optional. Informs that the group has been created
protected bool $groupChatCreated
return boolean

$leftChatMember protected property

Optional. A member was removed from the group, information about them (this member may be bot itself)
protected User,TelegramBot\Api\Types $leftChatMember
return User

$location protected property

Optional. Message is a shared location, information about the location
protected Location,TelegramBot\Api\Types $location
return TelegramBot\Api\Types\Location

$map protected static property

protected static array $map
return array

$messageId protected property

Unique message identifier
protected int $messageId
return integer

$migrateFromChatId protected property

Optional. The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value
protected int $migrateFromChatId
return integer

$migrateToChatId protected property

Optional. The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value
protected int $migrateToChatId
return integer

$newChatMember protected property

Optional. A new member was added to the group, information about them (this member may be bot itself)
protected User,TelegramBot\Api\Types $newChatMember
return User

$newChatPhoto protected property

Optional. A group photo was change to this value
protected mixed $newChatPhoto
return mixed

$newChatTitle protected property

Optional. A group title was changed to this value
protected string $newChatTitle
return string

$photo protected property

Optional. Message is a photo, available sizes of the photo array of \TelegramBot\Api\Types\Photo
protected array $photo
return array

$pinnedMessage protected property

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.
protected Message,TelegramBot\Api\Types $pinnedMessage
return Message

$replyToMessage protected property

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.
protected Message,TelegramBot\Api\Types $replyToMessage
return Message

$requiredParams protected static property

protected static array $requiredParams
return array

$sticker protected property

Optional. Message is a sticker, information about the sticker
protected Sticker,TelegramBot\Api\Types $sticker
return TelegramBot\Api\Types\Sticker

$supergroupChatCreated protected property

Optional. Service message: the supergroup has been created
protected bool $supergroupChatCreated
return boolean

$text protected property

Optional. For text messages, the actual UTF-8 text of the message
protected string $text
return string

$venue protected property

Optional. Message is a venue, information about the venue
protected Venue,TelegramBot\Api\Types $venue
return Venue

$video protected property

Optional. Message is a video, information about the video
protected Video,TelegramBot\Api\Types $video
return TelegramBot\Api\Types\Video

$voice protected property

Optional. Message is a voice message, information about the file
protected Voice,TelegramBot\Api\Types $voice
return TelegramBot\Api\Types\Voice