Expand description
§botkit
botkit is a Rust library for building chat bots with one handler model across multiple platforms.
The botkit crate is the facade entrypoint for the workspace. It re-exports botkit-core by
default and exposes platform adapters behind explicit feature flags.
§Installation
Use the facade crate when you want one dependency with opt-in platforms:
[dependencies]
botkit = { version = "0.1.0", features = ["telegram"] }Available facade features:
discordenablesbotkit::discordand theDiscordBotre-exports.telegramenablesbotkit::telegramand theTelegramBotre-exports.matrixenablesbotkit::matrixand theMatrixBotre-exports.fullenables all platform adapters.
You can also depend on the smaller crates directly:
botkit-coreprovides the shared bot abstractions, extractors, handlers, and response types.botkit-discordprovides the Discord integration.botkit-telegramprovides the Telegram integration.botkit-matrixprovides the Matrix integration.
§Design goals
- Reuse the same handler style across platforms.
- Keep the core abstractions transport-agnostic.
- Support async-first bot execution.
- Keep platform adapters opt-in instead of forcing heavy dependencies by default.
- Expose platform crates separately instead of hiding everything behind type erasure.
§Crates
§botkit
Facade crate that re-exports the core API and feature-gated platform integrations.
§botkit-core
Shared building blocks:
BotandBotBuilder- extractor-based handlers such as
User,CommandArgs, andMessageContent - unified
Responseand file response types
§botkit-discord
Discord support built around gateway events and command/button handlers.
§botkit-telegram
Telegram support for webhook-style handling and bot client operations.
§botkit-matrix
Matrix support built on top of matrix-sdk, including encrypted room support.
§Status
This project is a library workspace under active development. The API surface is still evolving.
Re-exports§
pub use botkit_core as core;
Modules§
Structs§
- BotBuilder
- Builder for constructing bots with handlers
- BotHandle
- Handle to control a running bot
- Button
Id - Button/callback ID extractor
- Channel
- Channel information extractor
- Chat
Action Guard - RAII guard that keeps a chat action active until dropped
- Command
Args - Command arguments extractor (Telegram-style string args)
- Command
Name - Command name extractor
- Context
- Context for handling bot events
- File
Response - File response data
- Message
Content - Message content extractor
- Response
- Unified bot response builder
- Typing
- Typing indicator extractor
- User
- User information extractor
Enums§
- BotError
- Main error type for bot operations
- Chat
Action - Chat action types for platform indicators
- Handler
Pattern - Option
Value - Command option value
Traits§
- Bot
- Unified Bot trait that hides connection mode differences
- Chat
Action Sender - Trait for sending chat actions to a channel
- Context
Data - Trait implemented by platform-specific context data
- From
Context - Trait for extracting typed data from bot context
- Handler
- Trait for bot event handlers
- Into
Handler - Trait to convert functions into handlers
- Into
Response - Trait for converting types into bot responses
Type Aliases§
- Boxed
Handler - Boxed handler for storage