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:
parent
ca82930279
commit
67ed228958
2 changed files with 2 additions and 2 deletions
|
@ -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!");
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue