Bot User • Rust AI Agent SDK
BotUser: Represents a user in a messaging platform.
BotUser
Defined in the bots module.
Rust AI Agent SDK
Represents a user in a messaging platform.
Fields
| Name | Type | Description |
|---|---|---|
user_id | String | Platform-specific user identifier |
username | Option<String> | User’s username (if available) |
display_name | Option<String> | User’s display name |
is_bot | bool | Whether this user is a bot |
metadata | HashMap<String | Additional platform-specific metadata |
serde_json | :Value> | Additional platform-specific metadata |
Methods
new
fn new(user_id: impl Into<String>) -> SelfCreate a new bot user.
Parameters:
| Name | Type |
|---|---|
user_id | impl Into<String> |
username
fn username(mut self, username: impl Into<String>) -> SelfSet username.
Parameters:
| Name | Type |
|---|---|
username | impl Into<String> |
display_name
fn display_name(mut self, name: impl Into<String>) -> SelfSet display name.
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
is_bot
fn is_bot(mut self, is_bot: bool) -> SelfSet is_bot flag.
Parameters:
| Name | Type |
|---|---|
is_bot | bool |
metadata
fn metadata(mut self, key: impl Into<String>, value: serde_json::Value) -> SelfAdd metadata.
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | serde_json::Value |
Source
View on GitHubpraisonai/src/bots/mod.rs at line 85