mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-25 23:52:04 +00:00
style: simplify inline answer returns
This commit is contained in:
@@ -228,12 +228,8 @@ async fn answer_inline_query(
|
||||
caption.clone().into_owned(),
|
||||
));
|
||||
}
|
||||
// Every item was skipped, or the post has no media at all: answer
|
||||
// *empty* rather than leaving the query unanswered (a client keeps
|
||||
// spinning on that, and the debounce's release re-runs the fetch on
|
||||
// every keystroke).
|
||||
answer(ctx.sender, query.id, results).await?;
|
||||
return Ok(true);
|
||||
Ok(true)
|
||||
}
|
||||
Ok(None) | Err(_) => {
|
||||
if let Err(e) = answer(ctx.sender, query.id, Vec::new()).await {
|
||||
@@ -243,7 +239,7 @@ async fn answer_inline_query(
|
||||
);
|
||||
return Err(e);
|
||||
}
|
||||
return Ok(true);
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user