Bot Protocol • Rust AI Agent SDK

BotProtocol: Bot protocol for chat integrations.

BotProtocol

Defined in the protocols module.

Rust AI Agent SDK

Bot protocol for chat integrations.

Methods

name

rust
fn name(&self) -> &str

Get bot name

on_message

rust
async fn on_message(&self, message: BotMessage) -> Result<BotResponse>

Handle incoming message

Parameters:

NameType
messageBotMessage

on_command

rust
async fn on_command(&self, command: &str, args: &[&str]) -> Result<BotResponse>

Handle command

Parameters:

NameType
command&str
args&[&str]

start

rust
async fn start(&mut self) -> Result<()>

Start the bot

stop

rust
async fn stop(&mut self) -> Result<()>

Stop the bot

Source

View on GitHub

praisonai/src/protocols/mod.rs at line 0


Related Documentation