Skip to main content

conogram/entities/
chosen_inline_result.rs

1use serde::{Deserialize, Serialize};
2
3use crate::entities::{location::Location, user::User};
4
5/// Represents a [result](https://core.telegram.org/bots/api/#inlinequeryresult) of an inline query that was chosen by the user and sent to their chat partner.
6///
7/// API Reference: [link](https://core.telegram.org/bots/api/#choseninlineresult)
8#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
9pub struct ChosenInlineResult {
10    /// The unique identifier for the result that was chosen
11    pub result_id: String,
12
13    /// The user that chose the result
14    pub from: User,
15
16    /// *Optional*. Sender location, only for bots that require user location
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub location: Option<Location>,
19
20    /// *Optional*. Identifier of the sent inline message. Available only if there is an [inline keyboard](https://core.telegram.org/bots/api/#inlinekeyboardmarkup) attached to the message. Will be also received in [callback queries](https://core.telegram.org/bots/api/#callbackquery) and can be used to [edit](https://core.telegram.org/bots/api/#updating-messages) the message.
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub inline_message_id: Option<String>,
23
24    /// The query that was used to obtain the result
25    pub query: String,
26}
27
28// Divider: all content below this line will be preserved after code regen