Fix examples/simple_commands_bot

This commit is contained in:
Temirkhan Myrzamadi 2020-02-14 03:48:26 +06:00
parent 7a582256ef
commit 8c5b1d3db0

View file

@ -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 {