PhpBotFramework  2.0.2
A framework for Telegram Bots' APIs.
Public Member Functions | List of all members
PhpBotFramework\Entities\CallbackQuery Class Reference

This object represents an incoming callback query from a callback button in an inline keyboard. More...

Inheritance diagram for PhpBotFramework\Entities\CallbackQuery:

Public Member Functions

string getData ()
 Get data parameter if it is set. More...
 
$chat_id getChatID ()
 Get chat ID of the chat where the message comes from. More...
 
Message getMessage ()
 Get message attached to this callback. More...
 
array getBotParameter ()
 (Internal) Get parameter to set to the bot. More...
 
int getID ()
 Get ID of this callback query. More...
 

Detailed Description

This object represents an incoming callback query from a callback button in an inline keyboard.

This object represents an incoming inline query.

If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present.

Exactly one of the fields data or game_short_name will be present.

When the user sends an empty query, your bot could return some default or trending results.

Member Function Documentation

◆ getBotParameter()

array PhpBotFramework\Entities\CallbackQuery::getBotParameter ( )

(Internal) Get parameter to set to the bot.

Each time the bot receive a callback query the parameter _callback_query_id will be set to the ID of this callback.

Returns
array Array with the parameter name as "var" index, and the id in "id" index.

◆ getChatID()

$chat_id PhpBotFramework\Entities\CallbackQuery::getChatID ( )

Get chat ID of the chat where the message comes from.

Returns
$chat_id Chat ID.

◆ getData()

string PhpBotFramework\Entities\CallbackQuery::getData ( )

Get data parameter if it is set.

Returns
string $data if set or empty string otherwise.

◆ getID()

int PhpBotFramework\Entities\CallbackQuery::getID ( )

Get ID of this callback query.

Returns
int $id ID of the callback.

◆ getMessage()

Message PhpBotFramework\Entities\CallbackQuery::getMessage ( )

Get message attached to this callback.

Returns
Message $message Message object attached to this callback.

The documentation for this class was generated from the following file: