conogram/entities/
chat_member_updated.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{
4    entities::{chat::Chat, chat_invite_link::ChatInviteLink, chat_member::ChatMember, user::User},
5    utils::deserialize_utils::is_false,
6};
7
8/// This object represents changes in the status of a chat member.
9///
10/// API Reference: [link](https://core.telegram.org/bots/api/#chatmemberupdated)
11#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12pub struct ChatMemberUpdated {
13    /// Chat the user belongs to
14    pub chat: Box<Chat>,
15
16    /// Performer of the action, which resulted in the change
17    pub from: User,
18
19    /// Date the change was done in Unix time
20    pub date: i64,
21
22    /// Previous information about the chat member
23    pub old_chat_member: ChatMember,
24
25    /// New information about the chat member
26    pub new_chat_member: ChatMember,
27
28    /// *Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
29    #[serde(default, skip_serializing_if = "Option::is_none")]
30    pub invite_link: Option<ChatInviteLink>,
31
32    /// *Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
33    #[serde(default, skip_serializing_if = "is_false")]
34    pub via_join_request: bool,
35
36    /// *Optional*. True, if the user joined the chat via a chat folder invite link
37    #[serde(default, skip_serializing_if = "is_false")]
38    pub via_chat_folder_invite_link: bool,
39}
40
41// Divider: all content below this line will be preserved after code regen