CallbackQuery
extends Entity
in package
Class CallbackQuery.
Tags
Table of Contents
- __call() : mixed|null
- Return the variable for the called getter or magically set properties dynamically.
- __construct() : mixed
- Entity constructor.
- __toString() : string
- Perform to string
- answer() : ServerResponse
- Answer this callback query.
- escapeMarkdown() : string
- Escape markdown special characters
- getBotUsername() :
- getChatInstance() :
- getData() :
- getFrom() :
- getGameShortName() :
- getId() :
- getInlineMessageId() :
- getMessage() :
- getProperty() : mixed
- Get a property from the current Entity
- getRawData() :
- subEntities() : array<string|int, mixed>
- Get the list of the properties that are themselves Entities
- toJson() : string
- Perform to json
- tryMention() : string|null
- Try to mention the user
- assignMemberVariables() : mixed
- Helper to set member variables
- makePrettyObjectArray() : array<string|int, mixed>
- Return an array of nice objects from an array of object arrays
- validate() : mixed
- Perform any special entity validation
Methods
__call()
Return the variable for the called getter or magically set properties dynamically.
public
__call( $method, $args) : mixed|null
Parameters
Return values
mixed|null —__construct()
Entity constructor.
public
__construct(array<string|int, mixed> $data[, string $bot_username = '' ]) : mixed
Parameters
- $data : array<string|int, mixed>
- $bot_username : string = ''
Tags
Return values
mixed —__toString()
Perform to string
public
__toString() : string
Return values
string —answer()
Answer this callback query.
public
answer([array<string|int, mixed> $data = [] ]) : ServerResponse
Parameters
- $data : array<string|int, mixed> = []
Return values
ServerResponse —escapeMarkdown()
Escape markdown special characters
public
escapeMarkdown(string $string) : string
Parameters
- $string : string
Return values
string —getBotUsername()
public
getBotUsername() :
Return the bot name passed to this entity
Return values
—getChatInstance()
public
getChatInstance() :
Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
Return values
—getData()
public
getData() :
Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field
Return values
—getFrom()
public
getFrom() :
Sender
Return values
—getGameShortName()
public
getGameShortName() :
Optional. Short name of a Game to be returned, serves as the unique identifier for the game
Return values
—getId()
public
getId() :
Unique identifier for this query
Return values
—getInlineMessageId()
public
getInlineMessageId() :
Optional. Identifier of the message sent via the bot in inline mode, that originated the query
Return values
—getMessage()
public
getMessage() :
Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
Return values
—getProperty()
Get a property from the current Entity
public
getProperty(mixed $property[, mixed $default = null ]) : mixed
Parameters
- $property : mixed
- $default : mixed = null
Return values
mixed —getRawData()
public
getRawData() :
Get the raw data passed to this entity
Return values
—subEntities()
Get the list of the properties that are themselves Entities
public
subEntities() : array<string|int, mixed>
Return values
array<string|int, mixed> —toJson()
Perform to json
public
toJson() : string
Return values
string —tryMention()
Try to mention the user
public
tryMention([bool $escape_markdown = false ]) : string|null
Mention the user with the username otherwise print first and last name if the $escape_markdown argument is true special characters are escaped from the output
Parameters
- $escape_markdown : bool = false
Return values
string|null —assignMemberVariables()
Helper to set member variables
protected
assignMemberVariables(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —makePrettyObjectArray()
Return an array of nice objects from an array of object arrays
protected
makePrettyObjectArray(string $class, string $property) : array<string|int, mixed>
This method is used to generate pretty object arrays mainly for PhotoSize and Entities object arrays.
Parameters
- $class : string
- $property : string
Return values
array<string|int, mixed> —validate()
Perform any special entity validation
protected
validate() : mixed