Skip to content

Commit

Permalink
API 7: reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Dec 30, 2023
1 parent 3c46562 commit dad59b7
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,52 @@ pub struct MessageEntity {
pub custom_emoji_id: Option<String>,
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum MessageOrigin {
User(MessageOriginUser),
HiddenUser(MessageOriginHiddenUser),
Chat(MessageOriginChat),
Channel(MessageOriginChannel),
}

#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct MessageOriginUser {
pub date: u64,
pub sender_user: User,
}

#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct MessageOriginHiddenUser {
pub date: u64,
#[builder(setter(into))]
pub sender_user_name: String,
}

#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct MessageOriginChat {
pub date: u64,

pub sender_chat: Chat,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub author_signature: Option<String>,
}

#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct MessageOriginChannel {
pub date: u64,

pub chat: Chat,

pub message_id: i32,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub author_signature: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct PhotoSize {
#[builder(setter(into))]
Expand Down

0 comments on commit dad59b7

Please sign in to comment.