1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54:22 +00:00

Move engine inside the inline query handler

Is there a better way to do this?
This commit is contained in:
Steffo 2022-08-08 16:18:55 +02:00
parent ca82930279
commit 67ed228958
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ async fn main() {
debug!("Creating handlers...");
let handler = dptree::entry()
.branch(inline_query_handler(&engine))
.branch(inline_query_handler(engine))
.branch(message_handler());
debug!("Created handlers!");

View file

@ -12,7 +12,7 @@ use crate::telegram::inline::card_to_inlinequeryresult;
/// Handle inline queries by searching cards on the [CardSearchEngine].
pub fn inline_query_handler(engine: &CardSearchEngine) -> Handler<DependencyMap, ResponseResult<()>, DpHandlerDescription> {
pub fn inline_query_handler(engine: CardSearchEngine) -> Handler<'static, DependencyMap, ResponseResult<()>, DpHandlerDescription> {
Update::filter_inline_query().chain(dptree::endpoint(move |query: InlineQuery, bot: Bot| {
info!("Handling inline query: `{}`", &query.query);