Function Hook_chat_bot_default->handle_commands
Definitions
sources/hooks/modules/chat_bots/default.php
- Handle hooks supported bot commands. Note multiple bots may support the same commands, and all respond. It is recommended all bots support the command 'help'.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $room_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the chatroom |
| $command | string | No | No | required parameter | N/A | N/A | The command used. This is just the chat message, so you can encode and recognise your own parameter scheme if you like. |
Returns
- Bot reply (null: bot does not handle the command)
- Type: ?string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Handle hooks supported bot commands. Note multiple bots may support the same commands, and all respond. It is recommended all bots support the command 'help'.
*
* @param AUTO_LINK $room_id The ID of the chatroom
* @param string $command The command used. This is just the chat message, so you can encode and recognise your own parameter scheme if you like.
* @return ?string Bot reply (null: bot does not handle the command)
*/
public function handle_commands(int $room_id, string $command) : ?string
* Handle hooks supported bot commands. Note multiple bots may support the same commands, and all respond. It is recommended all bots support the command 'help'.
*
* @param AUTO_LINK $room_id The ID of the chatroom
* @param string $command The command used. This is just the chat message, so you can encode and recognise your own parameter scheme if you like.
* @return ?string Bot reply (null: bot does not handle the command)
*/
public function handle_commands(int $room_id, string $command) : ?string

