Skip to main content

on_command

Method
This is a method of the BotProtocol class in the protocols module.
Decorator to register a command handler.

Signature

def on_command(command: str) -> Callable

Parameters

command
str
required
Command name (without /)

Returns

Returns
Callable
The 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...")