Fix a typo

This commit is contained in:
Temirkhan Myrzamadi 2020-02-19 21:19:22 +06:00
parent 332da2c3dd
commit e0d0e22ea6
3 changed files with 5 additions and 5 deletions

View file

@ -145,7 +145,7 @@ async fn answer(
Ok(()) Ok(())
} }
async fn handle_command(rx: DispatcherHandlerRx<Message>) { async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
// Only iterate through commands in a proper format: // Only iterate through commands in a proper format:
rx.commands::<Command>() rx.commands::<Command>()
// Execute all incoming commands concurrently: // Execute all incoming commands concurrently:

View file

@ -30,7 +30,7 @@ async fn answer(
Ok(()) Ok(())
} }
async fn handle_command(rx: DispatcherHandlerRx<Message>) { async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
// Only iterate through commands in a proper format: // Only iterate through commands in a proper format:
rx.commands::<Command>() rx.commands::<Command>()
// Execute all incoming commands concurrently: // Execute all incoming commands concurrently:
@ -51,5 +51,5 @@ async fn run() {
let bot = Bot::from_env(); let bot = Bot::from_env();
Dispatcher::new(bot).messages_handler(handle_command).dispatch().await; Dispatcher::new(bot).messages_handler(handle_commands).dispatch().await;
} }

View file

@ -131,7 +131,7 @@
//! Ok(()) //! Ok(())
//! } //! }
//! //!
//! async fn handle_command(rx: DispatcherHandlerRx<Message>) { //! async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
//! // Only iterate through commands in a proper format: //! // Only iterate through commands in a proper format:
//! rx.commands::<Command>() //! rx.commands::<Command>()
//! // Execute all incoming commands concurrently: //! // Execute all incoming commands concurrently:
@ -147,7 +147,7 @@
//! # teloxide::enable_logging!(); //! # teloxide::enable_logging!();
//! # log::info!("Starting simple_commands_bot!"); //! # log::info!("Starting simple_commands_bot!");
//! # let bot = Bot::from_env(); //! # let bot = Bot::from_env();
//! # Dispatcher::new(bot).messages_handler(handle_command).dispatch().await; //! # Dispatcher::new(bot).messages_handler(handle_commands).dispatch().await;
//! } //! }
//! ``` //! ```
//! //!