diff --git a/CHANGELOG.md b/CHANGELOG.md index 3422d890..9c8e6828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `ApiError::NotEnoughRightsToChangeChatPermissions` ([#155][pr155]) - Support for 5.4 telegram bot API ([#133][pr133]) - Support for 5.5 telegram bot API ([#143][pr143], [#164][pr164]) +- Support for 5.6 telegram bot API ([#162][pr162]) +- Support for 5.7 telegram bot API ([#175][pr175]) - `EditedMessageIsTooLong` error ([#109][pr109]) - `UntilDate` enum and use it for `{Restricted, Banned}::until_date` ([#117][pr117]) - `Limits::messages_per_min_channel` ([#121][pr121]) @@ -31,7 +33,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [pr151]: https://github.com/teloxide/teloxide-core/pull/151 [pr155]: https://github.com/teloxide/teloxide-core/pull/155 [pr156]: https://github.com/teloxide/teloxide-core/pull/156 +[pr162]: https://github.com/teloxide/teloxide-core/pull/162 [pr164]: https://github.com/teloxide/teloxide-core/pull/164 +[pr175]: https://github.com/teloxide/teloxide-core/pull/175 ### Changed diff --git a/src/types/input_file.rs b/src/types/input_file.rs index 33dcb31d..f36e5fc0 100644 --- a/src/types/input_file.rs +++ b/src/types/input_file.rs @@ -434,13 +434,13 @@ impl InputFileLike for Option { impl InputFileLike for InputSticker { fn copy_into(&self, into: &mut dyn FnMut(InputFile)) { - let (InputSticker::Png(input_file) | InputSticker::Tgs(input_file)) = self; + let (Self::Png(input_file) | Self::Tgs(input_file) | Self::Webm(input_file)) = self; input_file.copy_into(into) } fn move_into(&mut self, into: &mut dyn FnMut(InputFile)) { - let (InputSticker::Png(input_file) | InputSticker::Tgs(input_file)) = self; + let (Self::Png(input_file) | Self::Tgs(input_file) | Self::Webm(input_file)) = self; input_file.move_into(into) } diff --git a/src/types/input_sticker.rs b/src/types/input_sticker.rs index 8da456f6..827194ec 100644 --- a/src/types/input_sticker.rs +++ b/src/types/input_sticker.rs @@ -27,7 +27,12 @@ pub enum InputSticker { /// TGS animation with the sticker, uploaded using multipart/form-data. /// - /// See for technical requirements + /// See for technical requirements. #[serde(rename = "tgs_sticker")] Tgs(InputFile), + + /// WEBM video with the sticker, uploaded using multipart/form-data. + /// + /// See for technical requirements. + Webm(InputFile), } diff --git a/src/types/message.rs b/src/types/message.rs index 7405c7ad..454d721f 100644 --- a/src/types/message.rs +++ b/src/types/message.rs @@ -1222,6 +1222,7 @@ mod tests { "emoji": "😡", "set_name": "AdvenTimeAnim", "is_animated": true, + "is_video": false, "thumb": { "file_id": "AAQCAAMjAAOw0PgMaabKAcaXKCBLubkPAAQBAAdtAAPGKwACFgQ", "file_unique_id":"", @@ -1234,8 +1235,7 @@ mod tests { "file_size": 16639 } }"#; - let message = from_str::(json); - assert!(message.is_ok()); + from_str::(json).unwrap(); } #[test] diff --git a/src/types/sticker.rs b/src/types/sticker.rs index 235f774d..0f096727 100644 --- a/src/types/sticker.rs +++ b/src/types/sticker.rs @@ -27,6 +27,11 @@ pub struct Sticker { /// [animated]: https://telegram.org/blog/animated-stickers pub is_animated: bool, + /// `true`, if the sticker is a [video sticker]. + /// + /// [video sticker]: https://telegram.org/blog/video-stickers-better-reactions + pub is_video: bool, + /// Sticker thumbnail in the .webp or .jpg format. pub thumb: Option, diff --git a/src/types/sticker_set.rs b/src/types/sticker_set.rs index 5f501d60..3150518e 100644 --- a/src/types/sticker_set.rs +++ b/src/types/sticker_set.rs @@ -18,6 +18,11 @@ pub struct StickerSet { /// [animates stickers]: https://telegram.org/blog/animated-stickers pub is_animated: bool, + /// `true`, if the sticker is a [video sticker]. + /// + /// [video sticker]: https://telegram.org/blog/video-stickers-better-reactions + pub is_video: bool, + /// `true`, if the sticker set contains masks. pub contains_masks: bool,