fixed examples

This commit is contained in:
p0lunin 2020-02-23 14:18:21 +02:00
parent b5221d68a7
commit 1f1234c9bf
3 changed files with 3 additions and 3 deletions

View file

@ -179,7 +179,7 @@ async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
// Only iterate through messages from groups:
rx.filter(|cx| future::ready(cx.update.chat.is_group()))
// Only iterate through commands in a proper format:
.commands::<Command>(panic!("Insert here bot username"))
.commands::<Command, &str>(panic!("Insert here bot username"))
// Execute all incoming commands concurrently:
.for_each_concurrent(None, |(cx, command, args)| async move {
action(cx, command, &args).await.log_on_error().await;

View file

@ -32,7 +32,7 @@ async fn answer(
async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
// Only iterate through commands in a proper format:
rx.commands::<Command>(panic!("Insert here bot username"))
rx.commands::<Command, &str>(panic!("Insert here bot username"))
// Execute all incoming commands concurrently:
.for_each_concurrent(None, |(cx, command, _)| async move {
answer(cx, command).await.log_on_error().await;

View file

@ -108,7 +108,7 @@
//!
//! async fn handle_commands(rx: DispatcherHandlerRx<Message>) {
//! // Only iterate through commands in a proper format:
//! rx.commands::<Command>("bot_name")
//! rx.commands::<Command, _>("bot_name")
//! // Execute all incoming commands concurrently:
//! .for_each_concurrent(None, |(cx, command, _)| async move {
//! answer(cx, command).await.log_on_error().await;