teloxide_core/types/chosen_inline_result.rs
1use serde::{Deserialize, Serialize};
2
3use crate::types::{Location, User};
4
5/// Represents a [result] of an inline query that was chosen by the user and
6/// sent to their chat partner.
7///
8/// [The official docs](https://core.telegram.org/bots/api#choseninlineresult).
9///
10/// [result]: https://core.telegram.org/bots/api#inlinequeryresult
11#[serde_with::skip_serializing_none]
12#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
13pub struct ChosenInlineResult {
14 /// The unique identifier for the result that was chosen.
15 pub result_id: String,
16
17 /// The user that chose the result.
18 pub from: User,
19
20 /// A sender location, only for bots that require user location.
21 pub location: Option<Location>,
22
23 /// An identifier of the sent inline message. Available only if
24 /// there is an [inline keyboard] attached to the message. Will be also
25 /// received in [callback queries] and can be used to [edit] the message.
26 ///
27 /// [inline keyboard]: https://core.telegram.org/bots/api#inlinekeyboardmarkup
28 /// [callback queries]: https://core.telegram.org/bots/api#callbackquery
29 /// [edit]: https://core.telegram.org/bots/api#updating-messages
30 pub inline_message_id: Option<String>,
31
32 /// The query that was used to obtain the result.
33 pub query: String,
34}