[][src]Crate teloxide

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();

teloxide::repl(bot, |message| async move {
    message.answer_dice().send().await?;
    ResponseResult::<()>::Ok(())
})
.await;

Modules

dispatching

Updates dispatching.

error_handlers

Convenient error handling.

prelude

Commonly used items.

requests

API requests.

types

API types.

utils

Some useful utilities.

Macros

enable_logging

Enables logging through pretty-env-logger.

enable_logging_with_filter

Enables logging through pretty-env-logger with a custom filter for your program.

Structs

Bot

A requests sender.

BotBuilder

A builder of Bot, supporting some extra settings.

Enums

ApiErrorKind

A kind of an API error.

DownloadError

An error caused by downloading a file.

KnownApiErrorKind

A kind of a known API error.

RequestError

An error caused by sending a request to Telegram.

Functions

commands_repl

A REPL for commands.

commands_repl_with_listener

Like commands_repl, but with a custom UpdateListener.

dialogues_repl

A REPL for dialogues.

dialogues_repl_with_listener

Like dialogues_repl, but with a custom UpdateListener.

repl

A REPL for messages.

repl_with_listener

Like repl, but with a custom UpdateListener.