mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-22 18:08:31 +00:00
Add GiveawayCreated.prize_star_count.
This commit is contained in:
parent
3fdee61a88
commit
7422214945
@ -2419,6 +2419,22 @@ class Client::JsonChatShared final : public td::Jsonable {
|
|||||||
const Client *client_;
|
const Client *client_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Client::JsonGiveawayCreated final : public td::Jsonable {
|
||||||
|
public:
|
||||||
|
explicit JsonGiveawayCreated(const td_api::messageGiveawayCreated *giveaway_created)
|
||||||
|
: giveaway_created_(giveaway_created) {
|
||||||
|
}
|
||||||
|
void store(td::JsonValueScope *scope) const {
|
||||||
|
auto object = scope->enter_object();
|
||||||
|
if (giveaway_created_->star_count_ > 0) {
|
||||||
|
object("prize_star_count", giveaway_created_->star_count_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const td_api::messageGiveawayCreated *giveaway_created_;
|
||||||
|
};
|
||||||
|
|
||||||
class Client::JsonGiveaway final : public td::Jsonable {
|
class Client::JsonGiveaway final : public td::Jsonable {
|
||||||
public:
|
public:
|
||||||
JsonGiveaway(const td_api::messageGiveaway *giveaway, const Client *client) : giveaway_(giveaway), client_(client) {
|
JsonGiveaway(const td_api::messageGiveaway *giveaway, const Client *client) : giveaway_(giveaway), client_(client) {
|
||||||
@ -3290,9 +3306,11 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
|
|||||||
}
|
}
|
||||||
case td_api::messagePremiumGiftCode::ID:
|
case td_api::messagePremiumGiftCode::ID:
|
||||||
break;
|
break;
|
||||||
case td_api::messageGiveawayCreated::ID:
|
case td_api::messageGiveawayCreated::ID: {
|
||||||
object("giveaway_created", JsonEmptyObject());
|
auto content = static_cast<const td_api::messageGiveawayCreated *>(message_->content.get());
|
||||||
|
object("giveaway_created", JsonGiveawayCreated(content));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case td_api::messageGiveaway::ID: {
|
case td_api::messageGiveaway::ID: {
|
||||||
auto content = static_cast<const td_api::messageGiveaway *>(message_->content.get());
|
auto content = static_cast<const td_api::messageGiveaway *>(message_->content.get());
|
||||||
object("giveaway", JsonGiveaway(content, client_));
|
object("giveaway", JsonGiveaway(content, client_));
|
||||||
|
@ -194,6 +194,7 @@ class Client final : public WebhookActor::Callback {
|
|||||||
class JsonSharedUser;
|
class JsonSharedUser;
|
||||||
class JsonUsersShared;
|
class JsonUsersShared;
|
||||||
class JsonChatShared;
|
class JsonChatShared;
|
||||||
|
class JsonGiveawayCreated;
|
||||||
class JsonGiveaway;
|
class JsonGiveaway;
|
||||||
class JsonGiveawayWinners;
|
class JsonGiveawayWinners;
|
||||||
class JsonGiveawayCompleted;
|
class JsonGiveawayCompleted;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user