Document limit on the number of identifiers allowed in getCustomEmojiStickers.
This commit is contained in:
parent
7cdf1a05bb
commit
99b39069a4
@ -5992,7 +5992,7 @@ getAnimatedEmoji emoji:string = AnimatedEmoji;
|
||||
//@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested
|
||||
getEmojiSuggestionsUrl language_code:string = HttpUrl;
|
||||
|
||||
//@description Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned @custom_emoji_ids Identifiers of custom emoji stickers
|
||||
//@description Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned @custom_emoji_ids Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously
|
||||
getCustomEmojiStickers custom_emoji_ids:vector<int64> = Stickers;
|
||||
|
||||
|
||||
|
@ -5216,6 +5216,11 @@ void StickersManager::get_custom_emoji_stickers(vector<int64> &&document_ids, bo
|
||||
Promise<td_api::object_ptr<td_api::stickers>> &&promise) {
|
||||
TRY_STATUS_PROMISE(promise, G()->close_status());
|
||||
|
||||
constexpr size_t MAX_CUSTOME_EMOJI_IDS = 200; // server-side limit
|
||||
if (document_ids.size() > MAX_CUSTOME_EMOJI_IDS) {
|
||||
return promise.set_error(Status::Error(400, "Too many custom emoji identifiers specified"));
|
||||
}
|
||||
|
||||
td::unique(document_ids);
|
||||
|
||||
vector<int64> unknown_document_ids;
|
||||
|
Loading…
Reference in New Issue
Block a user