> ## 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.

# Bot Protocol • Rust AI Agent SDK

> BotProtocol: Bot protocol for chat integrations.

# BotProtocol

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Bot protocol for chat integrations.

## Methods

### `name`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn name(&self) -> &str
```

Get bot name

### `on_message`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn on_message(&self, message: BotMessage) -> Result<BotResponse>
```

Handle incoming message

**Parameters:**

| Name      | Type         |
| --------- | ------------ |
| `message` | `BotMessage` |

### `on_command`

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

Handle command

**Parameters:**

| Name      | Type      |
| --------- | --------- |
| `command` | `&str`    |
| `args`    | `&[&str]` |

### `start`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn start(&mut self) -> Result<()>
```

Start the bot

### `stop`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn stop(&mut self) -> Result<()>
```

Stop the bot

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/protocols/mod.rs">
  `praisonai/src/protocols/mod.rs` at line 0
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Bots" icon="robot" href="/docs/rust/bots" />

  <Card title="Rust AGUI" icon="display" href="/docs/rust/agui" />
</CardGroup>
