PHP 클래스 Telegram\Bot\Commands\CommandBus

파일 보기 프로젝트 열기: irazasyed/telegram-bot-sdk

보호된 프로퍼티들

프로퍼티 타입 설명
$commandAliases Holds all commands' aliases.
$commands Holds all commands.

공개 메소드들

메소드 설명
__construct ( Api $telegram ) Instantiate Command Bus.
addCommand ( Telegram\Bot\Commands\CommandInterface | string $command ) : CommandBus Add a command to the commands list.
addCommands ( array $commands ) : CommandBus Add a list of commands.
getCommands ( ) : array Returns the list of commands.
parseCommand ( $text ) : array Parse a Command for a Match.
removeCommand ( $name ) : CommandBus Remove a command from the list.
removeCommands ( array $names ) : CommandBus Removes a list of commands.

보호된 메소드들

메소드 설명
execute ( $name, $arguments, $message ) : mixed Execute the command.
handler ( $message, Update $update ) : Update Handles Inbound Messages and Executes Appropriate Command.

메소드 상세

__construct() 공개 메소드

Instantiate Command Bus.
public __construct ( Api $telegram )
$telegram Telegram\Bot\Api

addCommand() 공개 메소드

Add a command to the commands list.
public addCommand ( Telegram\Bot\Commands\CommandInterface | string $command ) : CommandBus
$command Telegram\Bot\Commands\CommandInterface | string Either an object or full path to the command class.
리턴 CommandBus

addCommands() 공개 메소드

Add a list of commands.
public addCommands ( array $commands ) : CommandBus
$commands array
리턴 CommandBus

execute() 보호된 메소드

Execute the command.
protected execute ( $name, $arguments, $message ) : mixed
$name
$arguments
$message
리턴 mixed

getCommands() 공개 메소드

Returns the list of commands.
public getCommands ( ) : array
리턴 array

handler() 보호된 메소드

Handles Inbound Messages and Executes Appropriate Command.
protected handler ( $message, Update $update ) : Update
$message
$update Telegram\Bot\Objects\Update
리턴 Telegram\Bot\Objects\Update

parseCommand() 공개 메소드

Parse a Command for a Match.
public parseCommand ( $text ) : array
$text
리턴 array

removeCommand() 공개 메소드

Remove a command from the list.
public removeCommand ( $name ) : CommandBus
$name
리턴 CommandBus

removeCommands() 공개 메소드

Removes a list of commands.
public removeCommands ( array $names ) : CommandBus
$names array
리턴 CommandBus

프로퍼티 상세

$commandAliases 보호되어 있는 프로퍼티

Holds all commands' aliases.
protected $commandAliases

$commands 보호되어 있는 프로퍼티

Holds all commands.
protected $commands