-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bot API 7.10 #2395
bot API 7.10 #2395
Conversation
coder2020official
commented
Sep 6, 2024
•
edited
Loading
edited
- Added updates about purchased paid media, represented by the class PaidMediaPurchased and the field purchased_paid_media in the class Update.
- Added the ability to specify a payload in sendPaidMedia that is received back by the bot in TransactionPartnerUser and purchased_paid_media updates.
- Added the field prize_star_count to the classes GiveawayCreated, Giveaway, GiveawayWinners and ChatBoostSourceGiveaway.
- Added the field is_star_giveaway to the class GiveawayCompleted.
- Added the field SecondaryButton to the class WebApp.
- Added the event secondaryButtonClicked for Mini Apps.
- Added the field bottomBarColor and the method setBottomBarColor to the class WebApp.
- Added the field bottom_bar_bg_color to the class ThemeParams.
Done. All others are related to webapps. |
Got it |
@Badiboy u done reviewing? |
@coder2020official Sorry, hard week |
telebot/apihelper.py
Outdated
@@ -530,7 +530,7 @@ def send_paid_media( | |||
token, chat_id, star_count, media, | |||
caption=None, parse_mode=None, caption_entities=None, show_caption_above_media=None, | |||
disable_notification=None, protect_content=None, reply_parameters=None, reply_markup=None, | |||
business_connection_id=None): | |||
business_connection_id=None, media_payload=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why parameter named "media_payload", but not "payload"?
I propose to set it to "payload" to keep naming consistency, and rename internal "payload" to something else. May be "_payload".
telebot/asyncio_helper.py
Outdated
@@ -520,7 +520,7 @@ async def send_paid_media( | |||
token, chat_id, star_count, media, | |||
caption=None, parse_mode=None, caption_entities=None, show_caption_above_media=None, | |||
disable_notification=None, protect_content=None, reply_parameters=None, reply_markup=None, | |||
business_connection_id=None): | |||
business_connection_id=None, media_payload=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here.
telebot/types.py
Outdated
@@ -9479,11 +9499,12 @@ def de_json(cls, json_string): | |||
obj['user'] = User.de_json(obj.get('user')) | |||
return cls(**obj) | |||
|
|||
def __init__(self, source, giveaway_message_id, user=None, is_unclaimed=None, **kwargs): | |||
def __init__(self, source, giveaway_message_id, user=None, is_unclaimed=None, prize_star_count=None, **kwargs): | |||
self.source: str = source | |||
self.giveaway_message_id: int = giveaway_message_id | |||
self.user: User = user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user should be Optional
telebot/types.py
Outdated
@@ -9479,11 +9499,12 @@ def de_json(cls, json_string): | |||
obj['user'] = User.de_json(obj.get('user')) | |||
return cls(**obj) | |||
|
|||
def __init__(self, source, giveaway_message_id, user=None, is_unclaimed=None, **kwargs): | |||
def __init__(self, source, giveaway_message_id, user=None, is_unclaimed=None, prize_star_count=None, **kwargs): | |||
self.source: str = source | |||
self.giveaway_message_id: int = giveaway_message_id | |||
self.user: User = user | |||
self.is_unclaimed: bool = is_unclaimed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_unclaimed should be Optional
Also need to add "purchased_paid_media" to util.update_types. And please, bump the version also ) |
Version is 4.23.0 which is still unreleased, no need for bumping |
@Badiboy done, please check and comment if needed; |
I propose to push a release. |
I don't mind, I think it is the time to do so |