mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Remove superfluous struct
This commit is contained in:
parent
f6ad066087
commit
43f8e73973
1 changed files with 6 additions and 21 deletions
|
@ -1,5 +1,4 @@
|
|||
use teloxide::{
|
||||
payloads::AnswerInlineQuery,
|
||||
prelude::*,
|
||||
types::{
|
||||
InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText,
|
||||
|
@ -52,27 +51,13 @@ async fn run() {
|
|||
thumb_height: Some(64),
|
||||
};
|
||||
|
||||
// Now put those responses into a "Result"
|
||||
// https://docs.rs/teloxide/0.5.1/teloxide/payloads/struct.AnswerInlineQuery.html
|
||||
let all_results = AnswerInlineQuery {
|
||||
inline_query_id: "03".to_string(), // again, anything -- as long as it's unique in this context
|
||||
results: vec![
|
||||
let results = vec![
|
||||
InlineQueryResult::Article(google_search),
|
||||
InlineQueryResult::Article(ddg_search),
|
||||
],
|
||||
cache_time: None,
|
||||
is_personal: None,
|
||||
next_offset: None,
|
||||
switch_pm_text: None,
|
||||
switch_pm_parameter: None,
|
||||
};
|
||||
|
||||
];
|
||||
// Send it off! One thing to note -- the ID we use here must be of the query we're responding to.
|
||||
let response = query
|
||||
.requester
|
||||
.answer_inline_query(query.update.id.to_string(), all_results.results)
|
||||
.send()
|
||||
.await;
|
||||
let response =
|
||||
query.requester.answer_inline_query(&query.update.id, results).send().await;
|
||||
if response.is_err() {
|
||||
dbg!(response);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue