conogram/entities/
external_reply_info.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{
4    entities::{
5        animation::Animation, audio::Audio, chat::Chat, contact::Contact, dice::Dice,
6        document::Document, game::Game, giveaway::Giveaway, giveaway_winners::GiveawayWinners,
7        invoice::Invoice, link_preview_options::LinkPreviewOptions, location::Location,
8        message_origin::MessageOrigin, paid_media_info::PaidMediaInfo, photo_size::PhotoSize,
9        poll::Poll, sticker::Sticker, story::Story, venue::Venue, video::Video,
10        video_note::VideoNote, voice::Voice,
11    },
12    utils::deserialize_utils::is_false,
13};
14
15/// This object contains information about a message that is being replied to, which may come from another chat or forum topic.
16///
17/// API Reference: [link](https://core.telegram.org/bots/api/#externalreplyinfo)
18#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19pub struct ExternalReplyInfo {
20    /// Origin of the message replied to by the given message
21    pub origin: MessageOrigin,
22
23    /// *Optional*. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
24    #[serde(default, skip_serializing_if = "Option::is_none")]
25    pub chat: Option<Box<Chat>>,
26
27    /// *Optional*. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
28    #[serde(default, skip_serializing_if = "Option::is_none")]
29    pub message_id: Option<i64>,
30
31    /// *Optional*. Options used for link preview generation for the original message, if it is a text message
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub link_preview_options: Option<LinkPreviewOptions>,
34
35    /// *Optional*. Message is an animation, information about the animation
36    #[serde(default, skip_serializing_if = "Option::is_none")]
37    pub animation: Option<Animation>,
38
39    /// *Optional*. Message is an audio file, information about the file
40    #[serde(default, skip_serializing_if = "Option::is_none")]
41    pub audio: Option<Audio>,
42
43    /// *Optional*. Message is a general file, information about the file
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub document: Option<Document>,
46
47    /// *Optional*. Message contains paid media; information about the paid media
48    #[serde(default, skip_serializing_if = "Option::is_none")]
49    pub paid_media: Option<PaidMediaInfo>,
50
51    /// *Optional*. Message is a photo, available sizes of the photo
52    #[serde(default, skip_serializing_if = "Vec::is_empty")]
53    pub photo: Vec<PhotoSize>,
54
55    /// *Optional*. Message is a sticker, information about the sticker
56    #[serde(default, skip_serializing_if = "Option::is_none")]
57    pub sticker: Option<Sticker>,
58
59    /// *Optional*. Message is a forwarded story
60    #[serde(default, skip_serializing_if = "Option::is_none")]
61    pub story: Option<Story>,
62
63    /// *Optional*. Message is a video, information about the video
64    #[serde(default, skip_serializing_if = "Option::is_none")]
65    pub video: Option<Video>,
66
67    /// *Optional*. Message is a [video note](https://telegram.org/blog/video-messages-and-telescope), information about the video message
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub video_note: Option<VideoNote>,
70
71    /// *Optional*. Message is a voice message, information about the file
72    #[serde(default, skip_serializing_if = "Option::is_none")]
73    pub voice: Option<Voice>,
74
75    /// *Optional*. *True*, if the message media is covered by a spoiler animation
76    #[serde(default, skip_serializing_if = "is_false")]
77    pub has_media_spoiler: bool,
78
79    /// *Optional*. Message is a shared contact, information about the contact
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub contact: Option<Contact>,
82
83    /// *Optional*. Message is a dice with random value
84    #[serde(default, skip_serializing_if = "Option::is_none")]
85    pub dice: Option<Dice>,
86
87    /// *Optional*. Message is a game, information about the game. [More about games »](https://core.telegram.org/bots/api/#games)
88    #[serde(default, skip_serializing_if = "Option::is_none")]
89    pub game: Option<Game>,
90
91    /// *Optional*. Message is a scheduled giveaway, information about the giveaway
92    #[serde(default, skip_serializing_if = "Option::is_none")]
93    pub giveaway: Option<Giveaway>,
94
95    /// *Optional*. A giveaway with public winners was completed
96    #[serde(default, skip_serializing_if = "Option::is_none")]
97    pub giveaway_winners: Option<GiveawayWinners>,
98
99    /// *Optional*. Message is an invoice for a [payment](https://core.telegram.org/bots/api/#payments), information about the invoice. [More about payments »](https://core.telegram.org/bots/api/#payments)
100    #[serde(default, skip_serializing_if = "Option::is_none")]
101    pub invoice: Option<Invoice>,
102
103    /// *Optional*. Message is a shared location, information about the location
104    #[serde(default, skip_serializing_if = "Option::is_none")]
105    pub location: Option<Location>,
106
107    /// *Optional*. Message is a native poll, information about the poll
108    #[serde(default, skip_serializing_if = "Option::is_none")]
109    pub poll: Option<Poll>,
110
111    /// *Optional*. Message is a venue, information about the venue
112    #[serde(default, skip_serializing_if = "Option::is_none")]
113    pub venue: Option<Venue>,
114}
115
116// Divider: all content below this line will be preserved after code regen