diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 630779dab..85b618866 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -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 = Stickers; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index f3b14c7c7..c3e519e08 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -5216,6 +5216,11 @@ void StickersManager::get_custom_emoji_stickers(vector &&document_ids, bo Promise> &&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 unknown_document_ids;