Add "has_public_winners" and "prize_description" giveaway fields.

This commit is contained in:
levlam 2023-12-20 16:19:06 +03:00
parent fd87df5fed
commit 1f512433ef

View File

@ -1981,10 +1981,16 @@ class Client::JsonGiveaway final : public td::Jsonable {
if (giveaway_->parameters_->only_new_members_) {
object("only_new_members", td::JsonTrue());
}
if (giveaway_->parameters_->has_public_winners_) {
object("has_public_winners", td::JsonTrue());
}
if (!giveaway_->parameters_->country_codes_.empty()) {
object("country_codes", td::json_array(giveaway_->parameters_->country_codes_,
[](td::Slice country_code) { return td::JsonString(country_code); }));
}
if (!giveaway_->parameters_->prize_description_.empty()) {
object("prize_description", giveaway_->parameters_->prize_description_);
}
if (giveaway_->month_count_ > 0) {
object("premium_subscription_month_count", giveaway_->month_count_);
}