PHP Class Telegram\Bot\Commands\Command

Inheritance: implements Telegram\Bot\Commands\CommandInterface, use trait Telegram\Bot\Answers\Answerable
Afficher le fichier Open project: irazasyed/telegram-bot-sdk Class Usage Examples

Protected Properties

Свойство Type Description
$aliases array Command Aliases Helpful when you want to trigger command with more than one name.
$arguments Arguments passed to the command.
$description The Telegram command description.
$name string Ex: help - Whenever the user sends /help, this would be resolved.

Méthodes publiques

Méthode Description
getAliases ( ) : array Get Command Aliases
getArguments ( ) : string Get Arguments passed to the command.
getCommandBus ( ) : CommandBus Returns an instance of Command Bus.
getDescription ( ) : string Get Command Description.
getName ( ) : string Get Command Name.
handle ( $arguments )
make ( Api $telegram, $arguments, Update $update )
setDescription ( $description ) : Command Set Command Description.
setName ( $name ) : Command Set Command Name.

Méthodes protégées

Méthode Description
triggerCommand ( $command, null $arguments = null ) : mixed Helper to Trigger other Commands.

Method Details

getAliases() public méthode

Get Command Aliases
public getAliases ( ) : array
Résultat array

getArguments() public méthode

Get Arguments passed to the command.
public getArguments ( ) : string
Résultat string

getCommandBus() public méthode

Returns an instance of Command Bus.
public getCommandBus ( ) : CommandBus
Résultat CommandBus

getDescription() public méthode

Get Command Description.
public getDescription ( ) : string
Résultat string

getName() public méthode

Get Command Name.
public getName ( ) : string
Résultat string

handle() abstract public méthode

abstract public handle ( $arguments )

make() public méthode

public make ( Api $telegram, $arguments, Update $update )
$telegram Telegram\Bot\Api
$update Telegram\Bot\Objects\Update

setDescription() public méthode

Set Command Description.
public setDescription ( $description ) : Command
$description
Résultat Command

setName() public méthode

Set Command Name.
public setName ( $name ) : Command
$name
Résultat Command

triggerCommand() protected méthode

Helper to Trigger other Commands.
protected triggerCommand ( $command, null $arguments = null ) : mixed
$command
$arguments null
Résultat mixed

Property Details

$aliases protected_oe property

Command Aliases Helpful when you want to trigger command with more than one name.
protected array $aliases
Résultat array

$arguments protected_oe property

Arguments passed to the command.
protected $arguments

$description protected_oe property

The Telegram command description.
protected $description

$name protected_oe property

Ex: help - Whenever the user sends /help, this would be resolved.
protected string $name
Résultat string