Remove repl from prelude

This commit is contained in:
Temirkhan Myrzamadi 2020-07-30 19:25:56 +06:00
parent 67af702a81
commit c81ec1602a
5 changed files with 7 additions and 5 deletions

View file

@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `frunk` feature -- enables `teloxide::utils::UpState`, which allows mapping from a structure of `field1, ..., fieldN` to a structure of `field1, ..., fieldN, fieldN+1`.
- Upgrade to v4.9 Telegram bots API.
- `teloxide::utils::client_from_env` -- constructs a client from the `TELOXIDE_TOKEN` environmental variable.
- Import `Transition`, `TransitionIn`, `TransitionOut`, `UpState`, `repl` to `teloxide::prelude`.
- Import `Transition`, `TransitionIn`, `TransitionOut`, `UpState` to `teloxide::prelude`.
- Import `repl` to `teloxide`.
- Let users inspect an unknown API error using `ApiErrorKind::Unknown(String)`. All the known API errors are placed into `KnownApiErrorKind`.
- Setters to all the API types.
- `teloxide::dispatching::dialogue::serializer` -- various serializers for memory storages. The `Serializer` trait, `Bincode`, `CBOR`, `JSON`.

View file

@ -102,7 +102,7 @@ async fn main() {
let bot = Bot::from_env();
repl(bot, |message| async move {
teloxide::repl(bot, |message| async move {
message.send_dice().send().await?;
Ok(())
})

View file

@ -13,7 +13,7 @@ async fn run() {
let bot = Bot::from_env();
repl(bot, |message| async move {
teloxide::repl(bot, |message| async move {
message.send_dice().send().await?;
Ok(())
})

View file

@ -15,7 +15,7 @@
//!
//! let bot = Bot::from_env();
//!
//! repl(bot, |message| async move {
//! teloxide::repl(bot, |message| async move {
//! message.send_dice().send().await?;
//! Ok(())
//! })
@ -42,6 +42,7 @@
#![forbid(unsafe_code)]
pub use bot::{Bot, BotBuilder};
pub use dispatching::repl;
pub use errors::{ApiErrorKind, DownloadError, KnownApiErrorKind, RequestError};
mod errors;

View file

@ -6,7 +6,7 @@ pub use crate::{
exit, next, DialogueDispatcher, DialogueStage, DialogueWithCx, GetChatId, Transition,
TransitionIn, TransitionOut,
},
repl, Dispatcher, DispatcherHandlerRx, DispatcherHandlerRxExt, UpdateWithCx,
Dispatcher, DispatcherHandlerRx, DispatcherHandlerRxExt, UpdateWithCx,
},
error_handlers::{LoggingErrorHandler, OnError},
requests::{Request, ResponseResult},