Closed sergix44 closed 2 months ago
Backward compatibility wasn't broken. Since Bot API 7.2 the field format
in InputSticker
is mandatory and must be always specified, but you don't pass it. Previously, createNewStickerSet
had mandatory parameter sticker_format
. You don't pass it either, therefore the request is invalid and isn't expected to succeed.
The format
field is required in all methods, including addStickerToSet
and setStickerSetThumbnail
. If you failed to specify it or specified an incorrect value, then it is hardly possible to predict effect of the request. It can succeed, fail, or succeed, but add a broken sticker to the set.
Okay, I see what you mean.
createNewStickerSet
method with the sticker_format
field, the API will continue to work the same way.
The important thing is that either the sticker_format
field or the format
field is set inside the InputSticker
.addStickerToSet
method, even though the format
parameter is mandatory as you say, it actually works even if it is not passed.setStickerSetThumbnail
method no longer works for old bots that use this method, because the format
parameter is now mandatory, which is a breaking change.Method | API 7.1 | API 7.2 | Breaking change? |
---|---|---|---|
createNewStickerSet |
sticker_format:β
stickers.*.format:β |
sticker_format:β
stickers.*.format:β
|
NO |
addStickerToSet | sticker.format:β | sticker.format:βoptional | NO |
setStickerSetThumbnail | format:β | format:β
|
β οΈ YES |
Backward compatibility wasn't broken. Since Bot API 7.2 the field
format
inInputSticker
is mandatory and must be always specified, but you don't pass it. Previously,createNewStickerSet
had mandatory parametersticker_format
. You don't pass it either, therefore the request is invalid and isn't expected to succeed.The
format
field is required in all methods, includingaddStickerToSet
andsetStickerSetThumbnail
. If you failed to specify it or specified an incorrect value, then it is hardly possible to predict effect of the request. It can succeed, fail, or succeed, but add a broken sticker to the set.
Yep you right about the the createNewStickerSet
call, my bad.
But the other stuff is still valid, so in addition the the @Lukasss93 's summary above, what I wanted to point out are the misleading error messages that the api returns in these cases, as well as the lack of validation with respect to the consistency between the uploaded file and the format field.
As for the addStickerToSet method, even though the format parameter is mandatory as you say, it actually works even if it is not passed.
It doesn't always work. It can work in some cases for backward compatibility for old bots. The parameter format
is mandatory in InputSticker
and must be always passed to ensure that the bot correctly works with mixed-format sticker packs.
setStickerSetThumbnail
works for old bots as it worked previously. Backward compatibility is enforced by Bot API and there were no backward compatibility breaking changes for requests in Bot API 7.2.
I got it. Thank you π
Thanks
Yesterday the Telegram team released Bot API 7.2. This update brings many changes, which we are already working on implementing.
However there is one major backward incompatible change, which is the removal of the fields StickerSet.is_animated/is_video. This unfortunately breaks the method Bot.get_sticker_set and affects all versions of our library. The current workaround for this if you have v20.8+ is to directly call await bot.do_api_request("get_sticker_set", {"name": sticker_set_name}) and parse the resulting JSON return value. The upcoming version of the library will address this incompatibility.
Thank you for understanding and being patient.
Hi! I'm one of the nutgram mantainers, while upgrading the framework to support the latest changes, we noticed a bunch of issues related to the new mixed format stickers:
~~Backwards compatibility has been broken:
Idk, might intented to be this way, but if yes, than doesnt make any sense why is not required while adding a sticker to a set:
~~
But a bigger issue is that the API accepts stickers that doesn't match the specified format (are also displayed correctly):![image](https://github.com/tdlib/telegram-bot-api/assets/4172890/e9db3af4-ad97-4eda-9a39-75a3d33a2ac5)
So, seems the API does not care what format contains, but only requires the format parameter to be present in the request π€
Same here, backwards compatibility has been broken, and a bunch of random errors are given for different combinations of input parameters:
But when ![image](https://github.com/tdlib/telegram-bot-api/assets/4172890/bd8fcdd2-9e7c-4fff-9a11-79af32f60628)
format
is specified, seems to work fine:cc @Lukasss93