> ## 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 Config • Rust AI Agent SDK

> BotConfig: Configuration for a bot.

# BotConfig

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

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

Configuration for a bot.

## Fields

| Name               | Type                   | Description                                    |
| ------------------ | ---------------------- | ---------------------------------------------- |
| `token`            | `String`               | Bot token for authentication                   |
| `platform`         | `String`               | Platform name (telegram, discord, slack, etc.) |
| `use_webhooks`     | `bool`                 | Whether to use webhooks (vs polling)           |
| `webhook_url`      | `Option&lt;String&gt;` | Webhook URL (if use\_webhooks is true)         |
| `polling_interval` | `u64`                  | Polling interval in seconds                    |
| `default`          | `"/")`                 | -                                              |
| `command_prefix`   | `String`               | Command prefix (default: "/")                  |
| `extra`            | `HashMap&lt;String`    | Additional platform-specific configuration     |
| `serde_json`       | `:Value&gt;`           | Additional platform-specific configuration     |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(token: impl Into<String>, platform: impl Into<String>) -> Self
```

Create a new bot config.

**Parameters:**

| Name       | Type                      |
| ---------- | ------------------------- |
| `token`    | `impl Into&lt;String&gt;` |
| `platform` | `impl Into&lt;String&gt;` |

### `webhooks`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn webhooks(mut self, url: impl Into<String>) -> Self
```

Enable webhooks.

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `url` | `impl Into&lt;String&gt;` |

### `polling_interval`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn polling_interval(mut self, seconds: u64) -> Self
```

Set polling interval.

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `seconds` | `u64` |

### `command_prefix`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn command_prefix(mut self, prefix: impl Into<String>) -> Self
```

Set command prefix.

**Parameters:**

| Name     | Type                      |
| -------- | ------------------------- |
| `prefix` | `impl Into&lt;String&gt;` |

### `extra`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn extra(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
```

Add extra configuration.

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `key`   | `impl Into&lt;String&gt;` |
| `value` | `serde_json::Value`       |

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Bots" icon="robot" href="/docs/rust/bots" />

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