Index: src/main.rs ================================================================== --- src/main.rs +++ src/main.rs @@ -33,14 +33,14 @@ }) } async fn handle(update: telegram_bot::Update, core: &core::Core, mut _reply_to: &Option) -> Result<()> { if let telegram_bot::UpdateKind::Message(message) = update.kind { - if let telegram_bot::MessageKind::Text { ref data, .. } = message.kind { - if let Some(from) = message.from { + if let Some(from) = message.from { + if let telegram_bot::MessageKind::BotCommand { ref cmd_str, .. } = message.kind { let sender = from.id; - let words: Vec<&str> = data.split_whitespace().collect(); + let words: Vec<&str> = cmd_str.split_whitespace().collect(); if let Err(err) = match words[0] { "/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(core, sender, words).await, "/start" => command::start(core, sender).await, "/list" => command::list(core, sender).await, "/add" | "/update" => command::update(core, sender, words).await,