Minor fixes
This commit is contained in:
+6
-3
@@ -20,7 +20,11 @@ pub fn get_dispatcher(
|
||||
token: String,
|
||||
db: Pool,
|
||||
) -> Dispatcher<Throttle<Bot>, 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::<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::<Update, InMemStorage<State>, State>()
|
||||
.branch(message_handler)
|
||||
.chain(callback_handler);
|
||||
|
||||
Reference in New Issue
Block a user