Skip to main content

Crate botkit_core

Crate botkit_core 

Source
Expand description

Platform-agnostic building blocks for the botkit bot framework.

Handlers are plain async functions. They declare what they need as parameters (FromContext extractors) and return anything that converts into a Response (IntoResponse). Adapters translate their platform’s payloads into a Context and route them through a BotBuilder.

Re-exports§

pub use action::AnyChatActionSender;
pub use action::ChatAction;
pub use action::ChatActionGuard;
pub use action::ChatActionSender;

Modules§

action
types

Structs§

AnyHandler
Type-erased Handler handle
BotBuilder
Builder for constructing bots with handlers
ButtonId
Button/callback ID extractor
Channel
Channel information extractor
CommandArgs
Command arguments extractor (Telegram-style string args)
CommandInfo
A registered command and the description shown in platform command menus
CommandName
Command name extractor
Context
Context for handling bot events
FileResponse
Bytes to upload, plus how to present them
MessageContent
Message content extractor
Response
Unified bot response builder
Shutdown
The receiving half of a shutdown signal, handed to crate::Bot::run_until
ShutdownSignal
Signals a running bot to stop
Typing
Typing indicator extractor
User
User information extractor

Enums§

BotError
Main error type for bot operations
Event
An incoming event, resolved to the shape the router dispatches on
FileSource
Where a file response’s bytes come from
OptionValue
Command option value

Traits§

Bot
Unified Bot trait that hides connection mode differences
ContextData
Trait implemented by platform-specific context data
FromContext
Trait for extracting typed data from bot context
Handler
Trait for bot event handlers
IntoHandler
Trait to convert functions into handlers
IntoResponse
Trait for converting types into bot responses