diff --git a/src/lib.rs b/src/lib.rs index ad083f9b..c789d14a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,11 +123,13 @@ fn impl_parse( let matching_values = infos.iter().map(|c| c.get_matched_value(global)); quote! { - fn parse(s: &str, bot_name: N) -> Result + fn parse(s: &str, bot_name: N) -> Result where N: Into { use std::str::FromStr; + use teloxide::utils::ParseError; + let mut words = s.splitn(2, ' '); let mut splited = words.next().expect("First item will be always.").split('@'); let command_raw = splited.next().expect("First item will be always.");