PHP Class Longman\TelegramBot\Entities\Message

Inheritance: extends Entity
Exibir arquivo Open project: akalongman/php-telegram-bot Class Usage Examples

Public Methods

Method Description
__construct ( array $data, string $bot_name = '' ) Message constructor
botAddedInChat ( ) : boolean Bot added in chat
getCommand ( ) : boolean | string Get command
getEntities ( ) : null | MessageEntity[] Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
getFullCommand ( ) : string | null return the entire command like /echo or /echo@bot1 if specified
getNewChatPhoto ( ) : null | Longman\TelegramBot\Entities\PhotoSize[] Optional. A chat photo was changed to this value
getPhoto ( ) : null | Longman\TelegramBot\Entities\PhotoSize[] Optional. Message is a photo, available sizes of the photo
getText ( boolean $without_cmd = false ) : string For text messages, the actual UTF-8 text of the message, 0-4096 characters.
getType ( ) : string | null Detect type based on properties.

Protected Methods

Method Description
subEntities ( )

Method Details

__construct() public method

Message constructor
public __construct ( array $data, string $bot_name = '' )
$data array
$bot_name string

botAddedInChat() public method

Bot added in chat
public botAddedInChat ( ) : boolean
return boolean

getCommand() public method

Get command
public getCommand ( ) : boolean | string
return boolean | string

getEntities() public method

This method overrides the default getEntities method and returns a nice array of MessageEntity objects.
public getEntities ( ) : null | MessageEntity[]
return null | MessageEntity[]

getFullCommand() public method

return the entire command like /echo or /echo@bot1 if specified
public getFullCommand ( ) : string | null
return string | null

getNewChatPhoto() public method

This method overrides the default getNewChatPhoto method and returns a nice array of PhotoSize objects.
public getNewChatPhoto ( ) : null | Longman\TelegramBot\Entities\PhotoSize[]
return null | Longman\TelegramBot\Entities\PhotoSize[]

getPhoto() public method

This method overrides the default getPhoto method and returns a nice array of PhotoSize objects.
public getPhoto ( ) : null | Longman\TelegramBot\Entities\PhotoSize[]
return null | Longman\TelegramBot\Entities\PhotoSize[]

getText() public method

For text messages, the actual UTF-8 text of the message, 0-4096 characters.
public getText ( boolean $without_cmd = false ) : string
$without_cmd boolean
return string

getType() public method

Detect type based on properties.
public getType ( ) : string | null
return string | null

subEntities() protected method

protected subEntities ( )