Add getPremiumStickers.

This commit is contained in:
levlam 2022-08-01 19:21:08 +03:00
parent 0f77d5c871
commit bca2a9c78e
4 changed files with 15 additions and 0 deletions

View File

@ -5922,6 +5922,9 @@ getStickers sticker_type:StickerType emoji:string limit:int32 = Stickers;
//@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned
searchStickers emoji:string limit:int32 = Stickers;
//@description Returns premium stickers from regular sticker sets @limit The maximum number of stickers to be returned
getPremiumStickers limit:int32 = Stickers;
//@description Returns a list of installed sticker sets @sticker_type Type of the sticker sets to return
getInstalledStickerSets sticker_type:StickerType = StickerSets;

View File

@ -6980,6 +6980,12 @@ void Td::on_request(uint64 id, td_api::searchStickers &request) {
stickers_manager_->search_stickers(std::move(request.emoji_), request.limit_, std::move(promise));
}
void Td::on_request(uint64 id, const td_api::getPremiumStickers &request) {
CHECK_IS_USER();
CREATE_REQUEST_PROMISE();
stickers_manager_->search_stickers("📂⭐️", request.limit_, std::move(promise));
}
void Td::on_request(uint64 id, const td_api::getInstalledStickerSets &request) {
CHECK_IS_USER();
CREATE_REQUEST(GetInstalledStickerSetsRequest, get_sticker_type(request.sticker_type_));

View File

@ -1057,6 +1057,8 @@ class Td final : public Actor {
void on_request(uint64 id, td_api::searchStickers &request);
void on_request(uint64 id, const td_api::getPremiumStickers &request);
void on_request(uint64 id, const td_api::getInstalledStickerSets &request);
void on_request(uint64 id, const td_api::getArchivedStickerSets &request);

View File

@ -2618,6 +2618,10 @@ class CliClient final : public Actor {
SearchQuery query;
get_args(args, query);
send_request(td_api::make_object<td_api::searchStickers>(query.query, query.limit));
} else if (op == "gprst") {
string limit;
get_args(args, limit);
send_request(td_api::make_object<td_api::getPremiumStickers>(as_limit(limit)));
} else if (op == "gss") {
int64 sticker_set_id;
get_args(args, sticker_set_id);