Skip to main content

rustigram_types/
direct_messages.rs

1use serde::{Deserialize, Serialize};
2
3use crate::user::User;
4
5/// A topic in a channel's direct messages chat.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct DirectMessagesTopic {
8    /// Unique identifier of the topic.
9    pub topic_id: i64,
10    /// The user that created the topic; currently always present.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub user: Option<User>,
13}
14
15/// Service message: the price for paid messages in a direct messages chat changed.
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct DirectMessagePriceChanged {
18    /// `true` if direct messages are enabled for the channel chat.
19    pub are_direct_messages_enabled: bool,
20    /// The new number of Telegram Stars users must pay per direct message.
21    ///
22    /// Does not apply to users exempted by administrators. Defaults to `0`.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub direct_message_star_count: Option<i64>,
25}
26
27/// Service message: the price for paid messages in the chat changed.
28#[derive(Debug, Clone, Serialize, Deserialize)]
29pub struct PaidMessagePriceChanged {
30    /// The new number of Telegram Stars non-administrator users must pay per message
31    /// in the supergroup chat.
32    pub paid_message_star_count: i64,
33}