mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Fix examples/simple_commands_bot
This commit is contained in:
parent
7a582256ef
commit
8c5b1d3db0
1 changed files with 8 additions and 2 deletions
|
@ -18,12 +18,18 @@ async fn handle_command(
|
|||
) -> Result<(), RequestError> {
|
||||
let text = match ctx.update.text() {
|
||||
Some(text) => text,
|
||||
None => return Ok(()),
|
||||
None => {
|
||||
log::info!("Received a message, but not text.");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
let command = match Command::parse(text) {
|
||||
Some((command, _)) => command,
|
||||
None => return Ok(()),
|
||||
None => {
|
||||
log::info!("Received a text message, but not a command.");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
match command {
|
||||
|
|
Loading…
Reference in a new issue