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

NameTypeDescription
user_idStringPlatform-specific user identifier
usernameOption<String>User’s username (if available)
display_nameOption<String>User’s display name
is_botboolWhether this user is a bot
metadataHashMap<StringAdditional platform-specific metadata
serde_json:Value>Additional platform-specific metadata

Methods

new

rust
fn new(user_id: impl Into<String>) -> Self

Create a new bot user.

Parameters:

NameType
user_idimpl Into&lt;String&gt;

username

rust
fn username(mut self, username: impl Into<String>) -> Self

Set username.

Parameters:

NameType
usernameimpl Into&lt;String&gt;

display_name

rust
fn display_name(mut self, name: impl Into<String>) -> Self

Set display name.

Parameters:

NameType
nameimpl Into&lt;String&gt;

is_bot

rust
fn is_bot(mut self, is_bot: bool) -> Self

Set is_bot flag.

Parameters:

NameType
is_botbool

metadata

rust
fn metadata(mut self, key: impl Into<String>, value: serde_json::Value) -> Self

Add metadata.

Parameters:

NameType
keyimpl Into&lt;String&gt;
valueserde_json::Value

Source

View on GitHub

praisonai/src/bots/mod.rs at line 85


Related Documentation