mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
fixed examples
This commit is contained in:
parent
b5221d68a7
commit
1f1234c9bf
3 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue