Add supergroupFullInfo.can_get_star_revenue_statistics.

This commit is contained in:
levlam 2024-07-05 14:18:38 +03:00
parent e1951c5a84
commit 0c7909d87e
3 changed files with 17 additions and 9 deletions

View File

@ -1307,6 +1307,7 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe
//@can_set_location True, if the supergroup location can be changed
//@can_get_statistics True, if the supergroup or channel statistics are available
//@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available
//@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available
//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available,
//-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators
@ -1323,7 +1324,7 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe
//@bot_commands List of commands of bots in the group
//@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none
//@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
//@class SecretChatState @description Describes the current secret chat state
@ -10915,7 +10916,7 @@ getChatRevenueTransactions chat_id:int53 offset:int32 limit:int32 = ChatRevenueT
//@description Returns detailed Telegram star revenue statistics
//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat
//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
//@is_dark Pass true if a dark theme is used by the application
getStarRevenueStatistics owner_id:MessageSender is_dark:Bool = StarRevenueStatistics;
@ -11198,7 +11199,7 @@ getStarPaymentOptions = StarPaymentOptions;
//@description Returns the list of Telegram star transactions for the specified owner
//@owner_id Identifier of the owner of the Telegram stars; can be the identifier of the current user, identifier of an owned bot,
//-or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true
//-or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
//@direction Direction of the transactions to receive; pass null to get all transactions
//@offset Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of transactions to return

View File

@ -2269,6 +2269,7 @@ void ChatManager::ChannelFull::store(StorerT &storer) const {
STORE_FLAG(can_view_revenue);
STORE_FLAG(has_can_have_sponsored_messages);
STORE_FLAG(has_paid_media_allowed);
STORE_FLAG(can_view_star_revenue);
END_STORE_FLAGS();
}
if (has_description) {
@ -2401,6 +2402,7 @@ void ChatManager::ChannelFull::parse(ParserT &parser) {
PARSE_FLAG(can_view_revenue);
PARSE_FLAG(has_can_have_sponsored_messages);
PARSE_FLAG(has_paid_media_allowed);
PARSE_FLAG(can_view_star_revenue);
END_PARSE_FLAGS();
}
if (has_description) {
@ -5372,6 +5374,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&chat_
auto boost_count = channel->boosts_applied_;
auto unrestrict_boost_count = channel->boosts_unrestrict_;
auto has_paid_media_allowed = channel->paid_media_allowed_;
auto can_view_star_revenue = channel->can_view_stars_revenue_;
StickerSetId sticker_set_id;
if (channel->stickerset_ != nullptr) {
sticker_set_id =
@ -5408,7 +5411,8 @@ void ChatManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&chat_
channel_full->has_pinned_stories != has_pinned_stories || channel_full->boost_count != boost_count ||
channel_full->unrestrict_boost_count != unrestrict_boost_count ||
channel_full->can_view_revenue != can_view_revenue ||
channel_full->has_paid_media_allowed != has_paid_media_allowed) {
channel_full->has_paid_media_allowed != has_paid_media_allowed ||
channel_full->can_view_star_revenue != can_view_star_revenue) {
channel_full->participant_count = participant_count;
channel_full->administrator_count = administrator_count;
channel_full->restricted_count = restricted_count;
@ -5429,6 +5433,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr<telegram_api::ChatFull> &&chat_
channel_full->unrestrict_boost_count = unrestrict_boost_count;
channel_full->can_view_revenue = can_view_revenue;
channel_full->has_paid_media_allowed = has_paid_media_allowed;
channel_full->can_view_star_revenue = can_view_star_revenue;
channel_full->is_changed = true;
}
@ -8887,11 +8892,12 @@ tl_object_ptr<td_api::supergroupFullInfo> ChatManager::get_supergroup_full_info_
slow_mode_delay_expires_in, channel_full->can_get_participants, has_hidden_participants,
can_hide_channel_participants(channel_id, channel_full).is_ok(), channel_full->can_set_sticker_set,
channel_full->can_set_location, channel_full->can_view_statistics, channel_full->can_view_revenue,
can_toggle_channel_aggressive_anti_spam(channel_id, channel_full).is_ok(), channel_full->is_all_history_available,
channel_full->can_have_sponsored_messages, channel_full->has_aggressive_anti_spam_enabled,
channel_full->has_paid_media_allowed, channel_full->has_pinned_stories, channel_full->boost_count,
channel_full->unrestrict_boost_count, channel_full->sticker_set_id.get(),
channel_full->emoji_sticker_set_id.get(), channel_full->location.get_chat_location_object(),
channel_full->can_view_star_revenue, can_toggle_channel_aggressive_anti_spam(channel_id, channel_full).is_ok(),
channel_full->is_all_history_available, channel_full->can_have_sponsored_messages,
channel_full->has_aggressive_anti_spam_enabled, channel_full->has_paid_media_allowed,
channel_full->has_pinned_stories, channel_full->boost_count, channel_full->unrestrict_boost_count,
channel_full->sticker_set_id.get(), channel_full->emoji_sticker_set_id.get(),
channel_full->location.get_chat_location_object(),
channel_full->invite_link.get_chat_invite_link_object(td_->user_manager_.get()), std::move(bot_commands),
get_basic_group_id_object(channel_full->migrated_from_chat_id, "get_supergroup_full_info_object"),
channel_full->migrated_from_max_message_id.get());

View File

@ -584,6 +584,7 @@ class ChatManager final : public Actor {
bool can_view_statistics = false;
bool is_can_view_statistics_inited = false;
bool can_view_revenue = false;
bool can_view_star_revenue = false;
bool is_all_history_available = true;
bool can_have_sponsored_messages = true;
bool has_aggressive_anti_spam_enabled = false;