Giter VIP home page Giter VIP logo

Comments (7)

Lukasss93 avatar Lukasss93 commented on June 19, 2024 3

Okay, I see what you mean.

  • If an old bot has always used the 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.
  • As for the addStickerToSet method, even though the format parameter is mandatory as you say, it actually works even if it is not passed.
  • Finally, the 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

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024 1

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.

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

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.

from telegram-bot-api.

sergix44 avatar sergix44 commented on June 19, 2024

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.

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.

from telegram-bot-api.

Lukasss93 avatar Lukasss93 commented on June 19, 2024

I got it. Thank you 😊

from telegram-bot-api.

sergix44 avatar sergix44 commented on June 19, 2024

Thanks

from telegram-bot-api.

Sithusoelwin35 avatar Sithusoelwin35 commented on June 19, 2024

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.

from telegram-bot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.