Documentation

InlinequeryCommand extends SystemCommand
in package

Inline query command

Table of Contents

$config  : array<string|int, mixed>
Command config
$description  : mixed
$enabled  : bool
If this command is enabled
$name  : mixed
$need_mysql  : bool
If this command needs mysql
$private_only  : mixed
$show_in_help  : bool
Show in Help
$telegram  : Telegram
Telegram object
$update  : Update
Update object
$usage  : string
Usage
$version  : mixed
__call()  : Command
Relay any non-existing function calls to Update object.
__construct()  : mixed
Constructor
execute()  : ServerResponse
A system command just executes
executeNoDb()  : ServerResponse
Execution if MySQL is required but not available
getCallbackQuery()  :
getChannelPost()  :
getChosenInlineResult()  :
getConfig()  : array<string|int, mixed>|mixed|null
Get command config
getDescription()  : string
Get description
getEditedChannelPost()  :
getEditedMessage()  :
getInlineQuery()  :
getMessage()  :
getName()  : string
Get name
getTelegram()  : Telegram
Get telegram object
getUpdate()  : Update
Get update object
getUsage()  : string
Get usage
getVersion()  : string
Get version
isAdminCommand()  : bool
If this is an AdminCommand
isEnabled()  : bool
Check if command is enabled
isPrivateOnly()  : bool
If this command is intended for private chats only.
isSystemCommand()  : bool
If this is a SystemCommand
isUserCommand()  : bool
If this is a UserCommand
preExecute()  : ServerResponse
Pre-execute command
replyToChat()  : ServerResponse
Helper to reply to a chat directly.
replyToUser()  : ServerResponse
Helper to reply to a user directly.
setUpdate()  : Command
Set update object
showInHelp()  : bool
Get Show in Help
removeNonPrivateMessage()  : bool
Delete the current message if it has been called in a non-private chat.

Properties

$config

Command config

protected array<string|int, mixed> $config = []

$enabled

If this command is enabled

protected bool $enabled = true

$need_mysql

If this command needs mysql

protected bool $need_mysql = false

$private_only

protected mixed $private_only = false

$show_in_help

Show in Help

protected bool $show_in_help = true

$usage

Usage

protected string $usage = 'Command usage'

Methods

__call()

Relay any non-existing function calls to Update object.

public __call(string $name, array<string|int, mixed> $arguments) : Command

This is purely a helper method to make requests from within execute() method easier.

Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
Command

__construct()

Constructor

public __construct(Telegram $telegram[, Update $update = null ]) : mixed
Parameters
$telegram : Telegram
$update : Update = null
Return values
mixed

getCallbackQuery()

public getCallbackQuery() :

Optional. New incoming callback query

Return values

getChannelPost()

public getChannelPost() :

Optional. New post in the channel, can be any kind — text, photo, sticker, etc.

Return values

getChosenInlineResult()

public getChosenInlineResult() :

Optional. The result of an inline query that was chosen by a user and sent to their chat partner.

Return values

getConfig()

Get command config

public getConfig([string|null $name = null ]) : array<string|int, mixed>|mixed|null

Look for config $name if found return it, if not return null. If $name is not set return all set config.

Parameters
$name : string|null = null
Return values
array<string|int, mixed>|mixed|null

getDescription()

Get description

public getDescription() : string
Return values
string

getEditedChannelPost()

public getEditedChannelPost() :

Optional. New version of a post in the channel that is known to the bot and was edited

Return values

getEditedMessage()

public getEditedMessage() :

Optional. New version of a message that is known to the bot and was edited

Return values

getInlineQuery()

public getInlineQuery() :

Optional. New incoming inline query

Return values

getMessage()

public getMessage() :

Optional. New incoming message of any kind — text, photo, sticker, etc.

Return values

getName()

Get name

public getName() : string
Return values
string

getUsage()

Get usage

public getUsage() : string
Return values
string

getVersion()

Get version

public getVersion() : string
Return values
string

isAdminCommand()

If this is an AdminCommand

public isAdminCommand() : bool
Return values
bool

isEnabled()

Check if command is enabled

public isEnabled() : bool
Return values
bool

isPrivateOnly()

If this command is intended for private chats only.

public isPrivateOnly() : bool
Return values
bool

isSystemCommand()

If this is a SystemCommand

public isSystemCommand() : bool
Return values
bool

isUserCommand()

If this is a UserCommand

public isUserCommand() : bool
Return values
bool

replyToChat()

Helper to reply to a chat directly.

public replyToChat(string $text[, array<string|int, mixed> $data = [] ]) : ServerResponse
Parameters
$text : string
$data : array<string|int, mixed> = []
Return values
ServerResponse

replyToUser()

Helper to reply to a user directly.

public replyToUser(string $text[, array<string|int, mixed> $data = [] ]) : ServerResponse
Parameters
$text : string
$data : array<string|int, mixed> = []
Return values
ServerResponse

showInHelp()

Get Show in Help

public showInHelp() : bool
Return values
bool

removeNonPrivateMessage()

Delete the current message if it has been called in a non-private chat.

protected removeNonPrivateMessage() : bool
Return values
bool

Search results