diff --git a/src/dispatching/handler_ext.rs b/src/dispatching/handler_ext.rs index f73dfb0a..932d5079 100644 --- a/src/dispatching/handler_ext.rs +++ b/src/dispatching/handler_ext.rs @@ -90,6 +90,6 @@ where { dptree::entry().chain(dptree::filter_map(move |message: Message, me: Me| { let bot_name = me.user.username.expect("Bots must have a username"); - message.text().and_then(|text| C::parse(text, bot_name).ok()) + message.text().and_then(|text| C::parse(text, &bot_name).ok()) })) } diff --git a/src/utils/command.rs b/src/utils/command.rs index 49dec198..c0f9cd2c 100644 --- a/src/utils/command.rs +++ b/src/utils/command.rs @@ -218,9 +218,7 @@ pub trait BotCommands: Sized { /// /// `bot_username` is required to parse commands like /// `/cmd@username_of_the_bot`. - fn parse(s: &str, bot_username: N) -> Result - where - N: Into; + fn parse(s: &str, bot_username: &str) -> Result; /// Returns descriptions of the commands suitable to be shown to the user /// (for example when `/help` command is used).