- Notifications
You must be signed in to change notification settings - Fork5.7k
Api 7.10 Paid media payload and Giveaway updates.#4463
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
14d4d2c
cf501a7
e25842d
f2cafec
a7e90a2
eaa3de4
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -56,6 +56,10 @@ class Giveaway(TelegramObject): | ||
country codes indicating the countries from which eligible users for the giveaway must | ||
come. If empty, then all users can participate in the giveaway. Users with a phone | ||
number that was bought on Fragment can always participate in giveaways. | ||
prize_star_count (:obj:`int`, optional): The number of Telegram Stars to be split between | ||
giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
premium_subscription_month_count (:obj:`int`, optional): The number of months the Telegram | ||
Premium subscription won from the giveaway will be active for. | ||
@@ -75,6 +79,10 @@ class Giveaway(TelegramObject): | ||
country codes indicating the countries from which eligible users for the giveaway must | ||
come. If empty, then all users can participate in the giveaway. Users with a phone | ||
number that was bought on Fragment can always participate in giveaways. | ||
prize_star_count (:obj:`int`): Optional. The number of Telegram Stars to be split between | ||
giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
premium_subscription_month_count (:obj:`int`): Optional. The number of months the Telegram | ||
Premium subscription won from the giveaway will be active for. | ||
""" | ||
@@ -86,6 +94,7 @@ class Giveaway(TelegramObject): | ||
"only_new_members", | ||
"premium_subscription_month_count", | ||
"prize_description", | ||
"prize_star_count", | ||
"winner_count", | ||
"winners_selection_date", | ||
) | ||
@@ -100,6 +109,7 @@ def __init__( | ||
prize_description: Optional[str] = None, | ||
country_codes: Optional[Sequence[str]] = None, | ||
premium_subscription_month_count: Optional[int] = None, | ||
prize_star_count: Optional[int] = None, | ||
*, | ||
api_kwargs: Optional[JSONDict] = None, | ||
): | ||
@@ -113,6 +123,7 @@ def __init__( | ||
self.prize_description: Optional[str] = prize_description | ||
self.country_codes: Tuple[str, ...] = parse_sequence_arg(country_codes) | ||
self.premium_subscription_month_count: Optional[int] = premium_subscription_month_count | ||
self.prize_star_count: Optional[int] = prize_star_count | ||
self._id_attrs = ( | ||
self.chats, | ||
@@ -145,13 +156,28 @@ def de_json( | ||
class GiveawayCreated(TelegramObject): | ||
"""This object represents a service message about the creation of a scheduled giveaway. | ||
Bibo-Joshi marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Args: | ||
prize_star_count (:obj:`int`, optional): The number of Telegram Stars to be | ||
split between giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
Attributes: | ||
prize_star_count (:obj:`int`): Optional. The number of Telegram Stars to be | ||
split between giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
""" | ||
__slots__ = ("prize_star_count",) | ||
def __init__( | ||
self, prize_star_count: Optional[int] = None, *, api_kwargs: Optional[JSONDict] = None | ||
): | ||
super().__init__(api_kwargs=api_kwargs) | ||
self.prize_star_count: Optional[int] = prize_star_count | ||
self._freeze() | ||
@@ -173,6 +199,10 @@ class GiveawayWinners(TelegramObject): | ||
winner_count (:obj:`int`): Total number of winners in the giveaway | ||
winners(Sequence[:class:`telegram.User`]): List of up to | ||
:tg-const:`telegram.constants.GiveawayLimit.MAX_WINNERS` winners of the giveaway | ||
prize_star_count (:obj:`int`, optional): The number of Telegram Stars to be split between | ||
giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
additional_chat_count (:obj:`int`, optional): The number of other chats the user had to | ||
join in order to be eligible for the giveaway | ||
premium_subscription_month_count (:obj:`int`, optional): The number of months the Telegram | ||
@@ -194,6 +224,10 @@ class GiveawayWinners(TelegramObject): | ||
:tg-const:`telegram.constants.GiveawayLimit.MAX_WINNERS` winners of the giveaway | ||
additional_chat_count (:obj:`int`): Optional. The number of other chats the user had to | ||
join in order to be eligible for the giveaway | ||
prize_star_count (:obj:`int`): Optional. The number of Telegram Stars to be split between | ||
giveaway winners; for Telegram Star giveaways only. | ||
.. versionadded:: NEXT.VERSION | ||
premium_subscription_month_count (:obj:`int`): Optional. The number of months the Telegram | ||
Premium subscription won from the giveaway will be active for | ||
unclaimed_prize_count (:obj:`int`): Optional. Number of undistributed prizes | ||
@@ -211,6 +245,7 @@ class GiveawayWinners(TelegramObject): | ||
"only_new_members", | ||
"premium_subscription_month_count", | ||
"prize_description", | ||
"prize_star_count", | ||
"unclaimed_prize_count", | ||
"was_refunded", | ||
"winner_count", | ||
@@ -231,6 +266,7 @@ def __init__( | ||
only_new_members: Optional[bool] = None, | ||
was_refunded: Optional[bool] = None, | ||
prize_description: Optional[str] = None, | ||
prize_star_count: Optional[int] = None, | ||
*, | ||
api_kwargs: Optional[JSONDict] = None, | ||
): | ||
@@ -247,6 +283,7 @@ def __init__( | ||
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 | ||
self._id_attrs = ( | ||
self.chat, | ||
@@ -295,21 +332,29 @@ class GiveawayCompleted(TelegramObject): | ||
unclaimed_prize_count (:obj:`int`, optional): Number of undistributed prizes | ||
giveaway_message (:class:`telegram.Message`, optional): Message with the giveaway that was | ||
completed, if it wasn't deleted | ||
is_star_giveaway (:obj:`bool`, optional): :obj:`True`, if the giveaway is a Telegram Star | ||
giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. | ||
.. versionadded:: NEXT.VERSION | ||
Attributes: | ||
winner_count (:obj:`int`): Number of winners in the giveaway | ||
unclaimed_prize_count (:obj:`int`): Optional. Number of undistributed prizes | ||
giveaway_message (:class:`telegram.Message`): Optional. Message with the giveaway that was | ||
completed, if it wasn't deleted | ||
is_star_giveaway (:obj:`bool`): Optional. :obj:`True`, if the giveaway is a Telegram Star | ||
giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. | ||
.. versionadded:: NEXT.VERSION | ||
""" | ||
__slots__ = ("giveaway_message", "is_star_giveaway", "unclaimed_prize_count", "winner_count") | ||
def __init__( | ||
self, | ||
winner_count: int, | ||
unclaimed_prize_count: Optional[int] = None, | ||
giveaway_message: Optional["Message"] = None, | ||
is_star_giveaway: Optional[bool] = None, | ||
*, | ||
api_kwargs: Optional[JSONDict] = None, | ||
): | ||
@@ -318,6 +363,7 @@ def __init__( | ||
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 | ||
self._id_attrs = ( | ||
self.winner_count, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -328,6 +328,9 @@ class TransactionPartnerUser(TransactionPartner): | ||
media bought by the user. | ||
.. versionadded:: 21.5 | ||
aelkheir marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
paid_media_payload (:obj:`str`, optional): Optional. Bot-specified paid media payload. | ||
.. versionadded:: NEXT.VERSION | ||
Attributes: | ||
type (:obj:`str`): The type of the transaction partner, | ||
@@ -338,19 +341,20 @@ class TransactionPartnerUser(TransactionPartner): | ||
media bought by the user. | ||
.. versionadded:: 21.5 | ||
aelkheir marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
paid_media_payload (:obj:`str`): Optional. Optional. Bot-specified paid media payload. | ||
.. versionadded:: NEXT.VERSION | ||
""" | ||
__slots__ = ("invoice_payload", "paid_media", "paid_media_payload", "user") | ||
def __init__( | ||
self, | ||
user: "User", | ||
invoice_payload: Optional[str] = None, | ||
paid_media: Optional[Sequence[PaidMedia]] = None, | ||
paid_media_payload: Optional[str] = None, | ||
*, | ||
api_kwargs: Optional[JSONDict] = None, | ||
) -> None: | ||
@@ -360,6 +364,7 @@ def __init__( | ||
self.user: User = user | ||
self.invoice_payload: Optional[str] = invoice_payload | ||
self.paid_media: Optional[Tuple[PaidMedia, ...]] = parse_sequence_arg(paid_media) | ||
self.paid_media_payload: Optional[str] = paid_media_payload | ||
self._id_attrs = ( | ||
self.type, | ||
self.user, | ||
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.