mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-22 18:08:31 +00:00
Support "direct_message_price_changed" messages.
This commit is contained in:
parent
58ed3b6666
commit
30ec8c9781
@ -2886,6 +2886,23 @@ class Client::JsonPaidMessagePriceChanged final : public td::Jsonable {
|
||||
const td_api::messagePaidMessagePriceChanged *price_changed_;
|
||||
};
|
||||
|
||||
class Client::JsonDirectMessagePriceChanged final : public td::Jsonable {
|
||||
public:
|
||||
explicit JsonDirectMessagePriceChanged(const td_api::messageDirectMessagePriceChanged *price_changed)
|
||||
: price_changed_(price_changed) {
|
||||
}
|
||||
void store(td::JsonValueScope *scope) const {
|
||||
auto object = scope->enter_object();
|
||||
object("are_direct_messages_enabled", td::JsonBool(price_changed_->is_enabled_));
|
||||
if (price_changed_->paid_message_star_count_ > 0) {
|
||||
object("direct_message_star_count", price_changed_->paid_message_star_count_);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const td_api::messageDirectMessagePriceChanged *price_changed_;
|
||||
};
|
||||
|
||||
class Client::JsonWebAppInfo final : public td::Jsonable {
|
||||
public:
|
||||
explicit JsonWebAppInfo(const td::string &url) : url_(url) {
|
||||
@ -3700,8 +3717,11 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
|
||||
}
|
||||
case td_api::messageGroupCall::ID:
|
||||
break;
|
||||
case td_api::messageDirectMessagePriceChanged::ID:
|
||||
case td_api::messageDirectMessagePriceChanged::ID: {
|
||||
auto content = static_cast<const td_api::messageDirectMessagePriceChanged *>(message_->content.get());
|
||||
object("direct_message_price_changed", JsonDirectMessagePriceChanged(content));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
@ -15509,8 +15529,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
|
||||
return true;
|
||||
case td_api::messageGroupCall::ID:
|
||||
return true;
|
||||
case td_api::messageDirectMessagePriceChanged::ID:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ class Client final : public WebhookActor::Callback {
|
||||
class JsonGiveawayCompleted;
|
||||
class JsonChatBoostAdded;
|
||||
class JsonPaidMessagePriceChanged;
|
||||
class JsonDirectMessagePriceChanged;
|
||||
class JsonStarAmount;
|
||||
class JsonReceivedGift;
|
||||
class JsonReceivedGifts;
|
||||
|
Loading…
x
Reference in New Issue
Block a user