tg_flows/types/inline_query.rs
1use serde::{Deserialize, Serialize};
2
3use crate::types::{ChatType, Location, User};
4
5/// This object represents an incoming inline query.
6///
7/// When the user sends an empty query, your bot could return some default or
8/// trending results.
9///
10/// [The official docs](https://core.telegram.org/bots/api#inlinequery).
11#[serde_with_macros::skip_serializing_none]
12#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
13pub struct InlineQuery {
14 /// Unique identifier for this query.
15 pub id: String,
16
17 /// Sender.
18 pub from: User,
19
20 /// Sender location, only for bots that request user location.
21 pub location: Option<Location>,
22
23 /// Text of the query (up to 512 characters).
24 pub query: String,
25
26 /// Offset of the results to be returned, can be controlled by the bot.
27 pub offset: String,
28
29 /// Type of the chat, from which the inline query was sent.
30 ///
31 /// The chat type should be always known for requests sent from official
32 /// clients and most third-party clients, unless the request was sent
33 /// from a secret chat.
34 pub chat_type: Option<ChatType>,
35}