Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
BotConfig
Defined in the bots module.
Rust AI Agent SDK
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<String> | Webhook URL (if use_webhooks is true) |
polling_interval | u64 | Polling interval in seconds |
default | "/") | - |
command_prefix | String | Command prefix (default: ”/“) |
extra | HashMap<String | Additional platform-specific configuration |
serde_json | :Value> | Additional platform-specific configuration |
Methods
new
fn new(token: impl Into<String>, platform: impl Into<String>) -> Self
Create a new bot config.
Parameters:
| Name | Type |
|---|
token | impl Into<String> |
platform | impl Into<String> |
webhooks
fn webhooks(mut self, url: impl Into<String>) -> Self
Enable webhooks.
Parameters:
| Name | Type |
|---|
url | impl Into<String> |
polling_interval
fn polling_interval(mut self, seconds: u64) -> Self
Set polling interval.
Parameters:
command_prefix
fn command_prefix(mut self, prefix: impl Into<String>) -> Self
Set command prefix.
Parameters:
| Name | Type |
|---|
prefix | impl Into<String> |
fn extra(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
Add extra configuration.
Parameters:
| Name | Type |
|---|
key | impl Into<String> |
value | serde_json::Value |
Source
View on GitHub
praisonai/src/bots/mod.rs at line 375