On Command • AI Agent SDK
on_command: Decorator to register a command handler.
on_command
Method
</div>
This is a method of the BotProtocol class in the protocols module.
Decorator to register a command handler.
Signature
def on_command(command: str) -> CallableParameters
ParamField
strCommand name (without /)
Returns
ResponseField
CallableThe result of the operation.
Usage
@bot.on_command("help")
async def handle_help(message: BotMessage):
await bot.send_message(message.channel.channel_id, "Help text...")Source
View on GitHubpraisonaiagents/bots/protocols.py at line 1191