mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 15:01:45 +01:00
commit
d83f7180c4
6 changed files with 24 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
|
|
|
@ -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::<Message>(json);
|
||||
assert!(message.is_ok());
|
||||
from_str::<Message>(json).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -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>,
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
Loading…
Reference in a new issue