mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-24 09:16:12 +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::{
|
use teloxide::{
|
||||||
payloads::AnswerInlineQuery,
|
|
||||||
prelude::*,
|
prelude::*,
|
||||||
types::{
|
types::{
|
||||||
InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText,
|
InlineQueryResult, InlineQueryResultArticle, InputMessageContent, InputMessageContentText,
|
||||||
|
@ -52,27 +51,13 @@ async fn run() {
|
||||||
thumb_height: Some(64),
|
thumb_height: Some(64),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Now put those responses into a "Result"
|
let results = vec![
|
||||||
// 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![
|
|
||||||
InlineQueryResult::Article(google_search),
|
InlineQueryResult::Article(google_search),
|
||||||
InlineQueryResult::Article(ddg_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.
|
// Send it off! One thing to note -- the ID we use here must be of the query we're responding to.
|
||||||
let response = query
|
let response =
|
||||||
.requester
|
query.requester.answer_inline_query(&query.update.id, results).send().await;
|
||||||
.answer_inline_query(query.update.id.to_string(), all_results.results)
|
|
||||||
.send()
|
|
||||||
.await;
|
|
||||||
if response.is_err() {
|
if response.is_err() {
|
||||||
dbg!(response);
|
dbg!(response);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue