Property | Type | Description | |
---|---|---|---|
$commandAliases | Holds all commands' aliases. | ||
$commands | Holds all commands. |
Method | Description | |
---|---|---|
__construct ( |
Instantiate Command Bus. | |
addCommand ( Telegram\Bot\Commands\CommandInterface | string $command ) : |
Add a command to the commands list. | |
addCommands ( array $commands ) : |
Add a list of commands. | |
getCommands ( ) : array | Returns the list of commands. | |
parseCommand ( $text ) : array | Parse a Command for a Match. | |
removeCommand ( $name ) : |
Remove a command from the list. | |
removeCommands ( array $names ) : |
Removes a list of commands. |
Method | Description | |
---|---|---|
execute ( $name, $arguments, $message ) : mixed | Execute the command. | |
handler ( $message, |
Handles Inbound Messages and Executes Appropriate Command. |
public __construct ( |
||
$telegram |
public addCommand ( Telegram\Bot\Commands\CommandInterface | string $command ) : |
||
$command | Telegram\Bot\Commands\CommandInterface | string | Either an object or full path to the command class. |
return |
public addCommands ( array $commands ) : |
||
$commands | array | |
return |
public getCommands ( ) : array | ||
return | array |
protected handler ( $message, |
||
$message | ||
$update | ||
return |
public parseCommand ( $text ) : array | ||
$text | ||
return | array |
public removeCommand ( $name ) : |
||
$name | ||
return |
public removeCommands ( array $names ) : |
||
$names | array | |
return |