Skip to content

Commit

Permalink
Bot API 7.1 (#148)
Browse files Browse the repository at this point in the history
* Bot API 7.1

* change type
  • Loading branch information
ayrat555 authored Feb 17, 2024
1 parent 227fd05 commit 21319e7
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@ pub struct Chat {
#[builder(setter(into, strip_option), default)]
pub slow_mode_delay: Option<u16>,

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

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub message_auto_delete_time: Option<u32>,
Expand Down Expand Up @@ -597,6 +601,10 @@ pub struct Chat {
#[builder(setter(into, strip_option), default)]
pub can_set_sticker_set: Option<bool>,

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

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub linked_chat_id: Option<i64>,
Expand All @@ -622,6 +630,10 @@ pub struct Message {
#[builder(setter(into, strip_option), default)]
pub sender_chat: Option<Box<Chat>>,

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

pub date: u64,

#[builder(setter(into))]
Expand Down Expand Up @@ -651,6 +663,10 @@ pub struct Message {
#[builder(setter(into, strip_option), default)]
pub quote: Option<Box<TextQuote>>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub reply_to_story: Option<Box<Story>>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub via_bot: Option<Box<User>>,
Expand Down Expand Up @@ -835,6 +851,10 @@ pub struct Message {
#[builder(setter(into, strip_option), default)]
pub proximity_alert_triggered: Option<Box<ProximityAlertTriggered>>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub boost_added: Option<Box<ChatBoostAdded>>,

#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
pub forum_topic_created: Option<Box<ForumTopicCreated>>,
Expand Down Expand Up @@ -1446,6 +1466,11 @@ pub struct MessageAutoDeleteTimerChanged {
pub message_auto_delete_time: u32,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct ChatBoostAdded {
pub boost_count: u32,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct ForumTopicCreated {
#[builder(setter(into))]
Expand Down Expand Up @@ -2106,12 +2131,11 @@ pub struct InputSticker {
pub keywords: Option<Vec<String>>,
}

// https://core.telegram.org/bots/api#story
// This object represents a message about a forwarded story in the chat.
// Currently holds no information.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)]
pub struct Story {}
pub struct Story {
pub chat: Chat,
pub id: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)]
pub struct StickerSet {
Expand Down

0 comments on commit 21319e7

Please sign in to comment.