diff --git a/src/dispatching.rs b/src/dispatching.rs index 5bcff94..e9fb8f0 100644 --- a/src/dispatching.rs +++ b/src/dispatching.rs @@ -20,7 +20,11 @@ pub fn get_dispatcher( token: String, db: Pool, ) -> Dispatcher, crate::Error, DefaultKey> { - let bot = Bot::new(token).throttle(Limits::default()); + let client = teloxide::net::default_reqwest_settings() + .https_only(true) + .build() + .expect("Failed to create reqwest Client"); + let bot = Bot::with_client(token, client).throttle(Limits::default()); let command_handler = filter_command::() .branch(case![Command::Start].endpoint(commands::start)) @@ -66,8 +70,7 @@ pub fn get_dispatcher( .branch(case![CallbackCommand::Alter(hash, field)].endpoint(callbacks::alter)) .chain(case![CallbackCommand::ChangeLocale(locale)].endpoint(callbacks::change_locale)); - let handler = dptree::entry() - .map_async(locales::Locale::from_update) + let handler = dptree::map_async(locales::Locale::from_update) .enter_dialogue::, State>() .branch(message_handler) .chain(callback_handler); diff --git a/src/dispatching/delete_mesage_handler.rs b/src/dispatching/delete_mesage_handler.rs index 9138179..794d2b3 100644 --- a/src/dispatching/delete_mesage_handler.rs +++ b/src/dispatching/delete_mesage_handler.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -/// Deletes the message without returining errors +/// Deletes the message without returning errors #[inline] pub async fn delete_message(bot: Throttle, msg: Message) { let ids = MessageIds::from(&msg); diff --git a/src/state/get_user.rs b/src/state/get_user.rs index f3d04ff..464320a 100644 --- a/src/state/get_user.rs +++ b/src/state/get_user.rs @@ -131,7 +131,7 @@ fn process_accounts( )?; } - error_text.push_str(&locale.fix_that_and_send_again); + write!(error_text, "\n{}", locale.fix_that_and_send_again)?; Ok(Err(error_text)) }