Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

TBA 5.7 #175

Merged
merged 4 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/types/input_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,13 @@ impl InputFileLike for Option<InputFile> {

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)
}
Expand Down
7 changes: 6 additions & 1 deletion src/types/input_sticker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ pub enum InputSticker {

/// TGS animation with the sticker, uploaded using multipart/form-data.
///
/// See <https://core.telegram.org/animated_stickers#technical-requirements> for technical requirements
/// See <https://core.telegram.org/animated_stickers#technical-requirements> for technical requirements.
#[serde(rename = "tgs_sticker")]
Tgs(InputFile),

/// WEBM video with the sticker, uploaded using multipart/form-data.
///
/// See <https://core.telegram.org/stickers#video-sticker-requirements> for technical requirements.
Webm(InputFile),
}
4 changes: 2 additions & 2 deletions src/types/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ mod tests {
"emoji": "😡",
"set_name": "AdvenTimeAnim",
"is_animated": true,
"is_video": false,
"thumb": {
"file_id": "AAQCAAMjAAOw0PgMaabKAcaXKCBLubkPAAQBAAdtAAPGKwACFgQ",
"file_unique_id":"",
Expand All @@ -1234,8 +1235,7 @@ mod tests {
"file_size": 16639
}
}"#;
let message = from_str::<Message>(json);
assert!(message.is_ok());
from_str::<Message>(json).unwrap();
}

#[test]
Expand Down
5 changes: 5 additions & 0 deletions src/types/sticker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PhotoSize>,

Expand Down
5 changes: 5 additions & 0 deletions src/types/sticker_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down