Crate teloxide[−][src]
Expand description
A full-featured framework that empowers you to easily build Telegram bots
using the async
/.await
syntax in Rust. It handles all the difficult
stuff so you can focus only on your business logic.
For a high-level overview, see our GitHub repository.
(Full)
use teloxide::prelude::*;
teloxide::enable_logging!();
log::info!("Starting dices_bot...");
let bot = Bot::from_env().auto_send();
teloxide::repl(bot, |message| async move {
message.answer_dice().await?;
respond(())
})
.await;
Cargo features
Feature | Description |
---|---|
redis-storage | Enables the Redis storage support for dialogues. |
sqlite-storage | Enables the Sqlite storage support for dialogues. |
cbor-serializer | Enables the CBOR serializer for dialogues. |
bincode-serializer | Enables the Bincode serializer for dialogues. |
macros | Re-exports macros from teloxide-macros . |
native-tls | Enables the native-tls TLS implementation (enabled by default). |
rustls | Enables the rustls TLS implementation. |
ctrlc_handler | Enables the Dispatcher::setup_ctrlc_handler function. |
auto-send | Enables the AutoSend bot adaptor. |
cache-me | Enables the CacheMe bot adaptor. |
frunk | Enables teloxide::utils::UpState . |
full | Enables all the features except nightly . |
nightly | Enables nightly-only features (see the teloxide-core features). |
Re-exports
pub use teloxide_macros as macros;
Modules
Wrappers altering functionality of a bot.
Updates dispatching.
Convenient error handling.
Network-specific API.
Request data sent to Telegram.
Commonly used items.
Commonly used items.
Telegram API requests.
Telergam API types.
Some useful utilities.
Macros
Enables logging through pretty-env-logger.
Enables logging through pretty-env-logger with a custom filter for your program.
Structs
A requests sender.
Enums
A kind of an API error.
An error caused by downloading a file.
An error caused by sending a request to Telegram.
Functions
A REPL for commands.
Like commands_repl
, but with a custom UpdateListener
.
A REPL for dialogues.
Like dialogues_repl
, but with a custom UpdateListener
.
Like repl
, but with a custom UpdateListener
.
A shortcut for ResponseResult::Ok(val)
.
Attribute Macros
macros
The docs is below.