-
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
Merged
Merged
bot API 7.10 #2395
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6ebe88d
added purchased paid media
coder2020official e3081fb
added payload to sendpaidmedia
coder2020official 155608e
prize_star_count and everything related to star giveaways
coder2020official ad70e7f
Update README.md
coder2020official f116f92
fix tests
coder2020official e7d0672
Merge branch 'botapi-710' of https://github.com/coder2020official/pyT…
coder2020official 3759a95
Fixes from review
coder2020official File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8994,6 +8994,9 @@ class Giveaway(JsonDeserializable): | |
:param country_codes: Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. | ||
:type country_codes: :obj:`list` of :obj:`str` | ||
|
||
:param prize_star_count: Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only | ||
:type prize_star_count: :obj:`int` | ||
|
||
:param premium_subscription_month_count: Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for | ||
:type premium_subscription_month_count: :obj:`int` | ||
|
||
|
@@ -9011,7 +9014,7 @@ def de_json(cls, json_string): | |
def __init__(self, chats: List[Chat], winners_selection_date: int, winner_count: int, | ||
only_new_members: Optional[bool] = None, has_public_winners: Optional[bool] = None, | ||
prize_description: Optional[str] = None, country_codes: Optional[List[str]] = None, | ||
premium_subscription_month_count: Optional[int] = None, **kwargs) -> None: | ||
premium_subscription_month_count: Optional[int] = None, prize_star_count: Optional[int] = None, **kwargs) -> None: | ||
self.chats: List[Chat] = chats | ||
self.winners_selection_date: int = winners_selection_date | ||
self.winner_count: int = winner_count | ||
|
@@ -9020,6 +9023,7 @@ def __init__(self, chats: List[Chat], winners_selection_date: int, winner_count: | |
self.prize_description: Optional[str] = prize_description | ||
self.country_codes: Optional[List[str]] = country_codes | ||
self.premium_subscription_month_count: Optional[int] = premium_subscription_month_count | ||
self.prize_star_count: Optional[int] = prize_star_count | ||
|
||
|
||
class GiveawayWinners(JsonDeserializable): | ||
|
@@ -9061,6 +9065,9 @@ class GiveawayWinners(JsonDeserializable): | |
:param prize_description: Optional. Description of additional giveaway prize | ||
:type prize_description: :obj:`str` | ||
|
||
:param prize_star_count: Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only | ||
:type prize_star_count: :obj:`int` | ||
|
||
:return: Instance of the class | ||
:rtype: :class:`GiveawayWinners` | ||
""" | ||
|
@@ -9077,7 +9084,7 @@ def __init__(self, chat: Chat, giveaway_message_id: int, winners_selection_date: | |
winners: List[User], additional_chat_count: Optional[int] = None, | ||
premium_subscription_month_count: Optional[int] = None, unclaimed_prize_count: Optional[int] = None, | ||
only_new_members: Optional[bool] = None, was_refunded: Optional[bool] = None, | ||
prize_description: Optional[str] = None, **kwargs) -> None: | ||
prize_description: Optional[str] = None, prize_star_count: Optional[int] = None, **kwargs) -> None: | ||
self.chat: Chat = chat | ||
self.giveaway_message_id: int = giveaway_message_id | ||
self.winners_selection_date: int = winners_selection_date | ||
|
@@ -9089,6 +9096,7 @@ def __init__(self, chat: Chat, giveaway_message_id: int, winners_selection_date: | |
self.only_new_members: Optional[bool] = only_new_members | ||
self.was_refunded: Optional[bool] = was_refunded | ||
self.prize_description: Optional[str] = prize_description | ||
self.prize_star_count: Optional[int] = prize_star_count | ||
|
||
|
||
class GiveawayCompleted(JsonDeserializable): | ||
|
@@ -9106,6 +9114,9 @@ class GiveawayCompleted(JsonDeserializable): | |
:param giveaway_message: Optional. Message with the giveaway that was completed, if it wasn't deleted | ||
:type giveaway_message: :class:`Message` | ||
|
||
:param is_star_giveaway: Optional. True, if the giveaway was a Telegram Star giveaway | ||
:type is_star_giveaway: :obj:`bool` | ||
|
||
:return: Instance of the class | ||
:rtype: :class:`GiveawayCompleted` | ||
""" | ||
|
@@ -9119,15 +9130,21 @@ def de_json(cls, json_string): | |
return cls(**obj) | ||
|
||
def __init__(self, winner_count: int, unclaimed_prize_count: Optional[int] = None, | ||
giveaway_message: Optional[Message] = None, **kwargs) -> None: | ||
giveaway_message: Optional[Message] = None, is_star_giveaway: Optional[bool] = None, **kwargs) -> None: | ||
self.winner_count: int = winner_count | ||
self.unclaimed_prize_count: Optional[int] = unclaimed_prize_count | ||
self.giveaway_message: Optional[Message] = giveaway_message | ||
self.is_star_giveaway: Optional[bool] = is_star_giveaway | ||
|
||
|
||
class GiveawayCreated(JsonDeserializable): | ||
""" | ||
This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. | ||
This object represents a service message about the creation of a scheduled giveaway. | ||
|
||
:prize_star_count: Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only | ||
:type prize_star_count: :obj:`int` | ||
|
||
:return: Instance of the class | ||
""" | ||
|
||
@classmethod | ||
|
@@ -9136,8 +9153,8 @@ def de_json(cls, json_string): | |
obj = cls.check_json(json_string) | ||
return cls(**obj) | ||
|
||
def __init__(self, **kwargs) -> None: | ||
pass | ||
def __init__(self, prize_star_count=None, **kwargs) -> None: | ||
self.prize_star_count: Optional[str] = prize_star_count | ||
|
||
|
||
class TextQuote(JsonDeserializable): | ||
|
@@ -9468,6 +9485,9 @@ class ChatBoostSourceGiveaway(ChatBoostSource): | |
:param is_unclaimed: True, if the giveaway was completed, but there was no user to win the prize | ||
:type is_unclaimed: :obj:`bool` | ||
|
||
:param prize_star_count: Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only | ||
:type prize_star_count: :obj:`int` | ||
|
||
:return: Instance of the class | ||
:rtype: :class:`ChatBoostSourceGiveaway` | ||
""" | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. is_unclaimed should be Optional |
||
self.prize_star_count: Optional[int] = prize_star_count | ||
|
||
|
||
class ChatBoost(JsonDeserializable): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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