Register Command • AI Agent SDK

register_command: Register a chat command handler.

register_command

Method

</div>

This is a method of the ChatCommandProtocol class in the protocols module.

Register a chat command handler.

Signature

python
def register_command(name: str, handler: Callable, description: str, usage: Optional[str]) -> None

Parameters

ParamField str

Command name (without /)

ParamField Callable

Async callable to handle the command

ParamField str

Human-readable description

ParamField Optional[str]

Usage example string

Source

View on GitHub

praisonaiagents/bots/protocols.py at line 1328