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

> BotUser: Represents a user in a messaging platform.

# BotUser

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

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

Represents a user in a messaging platform.

## Fields

| Name           | Type                   | Description                           |
| -------------- | ---------------------- | ------------------------------------- |
| `user_id`      | `String`               | Platform-specific user identifier     |
| `username`     | `Option&lt;String&gt;` | User's username (if available)        |
| `display_name` | `Option&lt;String&gt;` | User's display name                   |
| `is_bot`       | `bool`                 | Whether this user is a bot            |
| `metadata`     | `HashMap&lt;String`    | Additional platform-specific metadata |
| `serde_json`   | `:Value&gt;`           | Additional platform-specific metadata |

## Methods

### `new`

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

Create a new bot user.

**Parameters:**

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

### `username`

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

Set username.

**Parameters:**

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

### `display_name`

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

Set display name.

**Parameters:**

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

### `is_bot`

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

Set is\_bot flag.

**Parameters:**

| Name     | Type   |
| -------- | ------ |
| `is_bot` | `bool` |

### `metadata`

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

Add metadata.

**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#L85">
  `praisonai/src/bots/mod.rs` at line 85
</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>
