Comments (7)
Okay, I see what you mean.
- If an old bot has always used the
createNewStickerSet
method with thesticker_format
field, the API will continue to work the same way.
The important thing is that either thesticker_format
field or theformat
field is set inside theInputSticker
. - As for the
addStickerToSet
method, even though theformat
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 theformat
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:β
|
from telegram-bot-api.
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.
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.
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.
from telegram-bot-api.
I got it. Thank you π
from telegram-bot-api.
Thanks
from telegram-bot-api.
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)
- Error while getting api_hash and api_id. HOT 11
- The terminal does not respond after the command is executed HOT 1
- Add support for `channels.toggleForum` (as per documentation) HOT 7
- Connection refused HOT 1
- send a pdf document with sendMessage HOT 9
- Fatal log is already here:
- Let's imagine that we have a ~4gb file, and a premium subscription on the account. So we are trying to upload the file using preliminary wrappers, we do perform the request, wait until the file is loaded, and chunk are saved on the server-side/cdn whatever, close the database, then we open it again, let's say 10 minutes later, we are trying to upload it, but due to the tdlib cache we just run into a weird situation where the filds 'is_uploading_active' are being set as true in the response to the original 'preliminaryUploadFile', even though the file is already uploaded and the uploaded_size matches the size, and expected_size fields values, while 'is_uploading_completed' is being set to false.
- [Question]: Is `ChatJoinRequest.invite_link` always null for public groups? HOT 1
- How legal is using getChannelDifference for public channels HOT 5
- hajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
- Does telegram-bot-api still not support uploading files up to 4G? HOT 7
- How to create a service on Ubuntu HOT 1
- Tgram.api
- http proxy does not work! HOT 1
- Message entities are not preserved by `editMessageText` and `editMessageMedia` HOT 2
- Request: Add Possibility for bot to publish/maintain stories in Channels
- NOT: User.language_code described at IETF but only being used as ISO-639? HOT 3
- How should I apply for the API HOT 4
- How can I be sure that Telegram BOT API local server is running properly? HOT 4
- Blockquote HTML syntax issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-bot-api.