New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/support tba 6.6 #1040
base: master
Are you sure you want to change the base?
Feature/support tba 6.6 #1040
Conversation
(teloxidebot has picked a reviewer for you, use r? to override) |
I bet one day they will rename "thumbnail" back to "thumb"... CHANGELOG.md changes in progress |
crates/teloxide-core/CHANGELOG.md
Outdated
- Support for TBA 6.6 ([#1040](pr1040)) | ||
- Add methods for working with bot's description: | ||
- `set_my_description` | ||
- `get_my_description` | ||
- `set_my_short_description` | ||
- `get_my_short_description` | ||
- Add methods for working with sticker sets: | ||
- `set_custom_emoji_sticker_set_thumbnail` | ||
- `set_sticker_set_title` | ||
- `delete_sticker_set` | ||
- `set_sticker_emoji_list` | ||
- `set_sticker_keywords` | ||
- `set_sticker_mask_position` | ||
- Add parameter `emoji` to the `send_sticker` method | ||
- Add field `needs_repainting` to the struct `Sticker` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be missing some changes from the bot API. Did you forget to do them, or only to document them?
- Added support for the creation of custom emoji sticker sets in createNewStickerSet.
- Added the parameter needs_repainting to the method createNewStickerSet to automatically change the color of emoji based on context (e.g., use text color in messages, accent color in statuses, etc.).
- Replaced the parameters png_sticker, tgs_sticker, webm_sticker, emojis and mask_position in the method addStickerToSet with the parameter sticker of the type InputSticker.
- Added support for the creation of sticker sets with multiple initial stickers in createNewStickerSet by replacing the parameters png_sticker, tgs_sticker, webm_sticker, emojis and mask_position with the parameters stickers and sticker_format.
- Added support for .WEBP files in createNewStickerSet and addStickerToSet.
- probably no code changes, but the documentation should be adjusted
- Added support for .WEBP, .TGS, and .WEBM files in uploadStickerFile by replacing the parameter png_sticker in the method uploadStickerFile with the parameters sticker and sticker_format.
- Added the ability to specify search keywords for stickers added to sticker sets.
- Renamed the method setStickerSetThumb to setStickerSetThumbnail and its parameter thumb to thumbnail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was making the to-do list I just copied changes one by one from the telegram's changelog. Eventually I noticed that some of them are internal changes with no code changes, so I left them as is.
I did all necessary changes according to the list except the first one ("Added support for the creation of custom emoji sticker sets in createNewStickerSet."). It is documented in a strange way and if I'm not mistaken doesn't require any code changes. (or it refers to other changes which are implemented)
Yeah, it seems that I forgot to document some changes, will adjust it soon
@teloxidebot review |
// FIXME: CreateNewStickerSet has to be be only Debug + Clone + Serialize (maybe | ||
// better fix?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym?
/// Format of the added sticker, must be one of “static” for a .WEBP or .PNG | ||
/// image, “animated” for a .TGS animation, “video” for a WEBM video | ||
pub format: StickerFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field was only added in 7.2.
/// PNG image with the sticker, must be up to 512 kilobytes in size, | ||
/// dimensions must not exceed 512px, and either width or height must be | ||
/// exactly 512px. | ||
pub struct InputSticker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that all methods that take InputSticker
still work with this different serialization?
|
||
/// True, if the sticker must be repainted to a text color in messages, the | ||
/// color of the Telegram Premium badge in emoji status, white color on | ||
/// chat photos, or another appropriate color in other places | ||
pub needs_repainting: Option<True>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// True, if the sticker must be repainted to a text color in messages, the | |
/// color of the Telegram Premium badge in emoji status, white color on | |
/// chat photos, or another appropriate color in other places | |
pub needs_repainting: Option<True>, | |
/// `true`, if the sticker must be repainted to a text color in messages, the | |
/// color of the Telegram Premium badge in emoji status, white color on | |
/// chat photos, or another appropriate color in other places | |
#[serde(default)] | |
pub needs_repainting: bool, |
@@ -44,13 +44,18 @@ pub struct Sticker { | |||
pub format: StickerFormat, | |||
|
|||
/// Sticker thumbnail in the `.webp` or `.jpg` format. | |||
pub thumb: Option<PhotoSize>, | |||
pub thumbnail: Option<PhotoSize>, | |||
|
|||
/// Emoji associated with the sticker. | |||
pub emoji: Option<String>, | |||
|
|||
/// Name of the sticker set to which the sticker belongs. | |||
pub set_name: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all those options have #[serde(default)]
s? 🤔
Could you investigate? (separately from this PR)
@@ -107,6 +127,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
- Methods of the Message type: `delete_chat_photo`, `group_chat_created`, `super_group_chat_created`, `channel_chat_created`, `chat_migration`, `migrate_to_chat_id`, `migrate_from_chat_id` now return shared reference instead of owned value inside `Option` ([#982][pr982]) | |||
- Methods `delete_chat_photo`, `group_chat_created`, `super_group_chat_created`, `channel_chat_created` now return appropriate structs not `Option<True>` ([#982][pr982]) | |||
- MSRV (Minimal Supported Rust Version) was bumped from `1.68.0` to `1.70.0` ([#996][pr996]) | |||
- Renamed `SendAnimation::thumb`, `SendAudio::thumb`, `SendDocument::thumb`, `SendSticker::thumb`, `SendVideo::thumb`, `SendVideoNote::thumb` into `thumbnail`([#1040][pr1040]) | |||
- Renamed `{Animation, Audio, Document, Sticker, Video, VideoNote, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaVideo, StickerSet}::thumb` into `thumbnail` ([#1040][pr1040]) | |||
- Renamed `StickerFormat::Raster` into `StickerFormat::Static` ([#1040][pr1040]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also mention all the is_rater
->is_static
functions
@@ -146,11 +146,20 @@ mod tests { | |||
|
|||
#[tokio::test] | |||
async fn test_add_sticker_to_set() { | |||
// FIXME: rewrite according to the new schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
- Renamed `thumb_url`, `thumb_width`, `thumb_height` into `thumbnail_url`, `thumbnail_width`, `thumbnail_height` in `InlineQueryResultArticle`, `InlineQueryResultContact`, `InlineQueryResultDocument`, `InlineQueryResultLocation`, `InlineQueryResultVenue` ([#1040][pr1040]) | ||
- Renamed `thumb_url` into `thumbnail_url` in `InlineQueryResultPhoto`, `InlineQueryResultVideo` ([#1040][pr1040]) | ||
- Renamed `thumb_url` into `thumbnail_url` in `InlineQueryResultGif`, `InlineQueryResultMpeg4Gif` ([#1040][pr1040]) | ||
- `InputSticker` now is the struct that is used as parameter-bucket for sticker-related functionality, previously it was a wrap over the `png`, `tgs` and `webm` files ([#1040][pr1040]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of repeating the PR all the time do
- Implement Telegram Bot API version ... [#...][...]
- blah
- blah
Close #1035
For more information, see the changes on the Telegram page and the teloxide-core CHANGELOG