> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# On Command • Rust AI Agent SDK

> on_command: Handle command

# on\_command

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**BotProtocol**](../classes/BotProtocol) class in the [**protocols**](../modules/protocols) module.

Handle command

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def on_command(&self, command: &str, args: &[&str]) -> Result<BotResponse>
```

## Parameters

<ParamField query="command" type="&str" required={true}>
  No description available.
</ParamField>

<ParamField query="args" type="&" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Result<BotResponse>">
  The result of the operation.
</ResponseField>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust CLI" icon="terminal" href="/docs/rust/cli" />
</CardGroup>
