Skip to content

Commit

Permalink
Added the field gift to the class TransactionPartnerUser.
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Nov 17, 2024
1 parent a2d2a86 commit 9c7c47f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10495,17 +10495,21 @@ class TransactionPartnerUser(TransactionPartner):
:param paid_media: Optional. Information about the paid media bought by the user
:type paid_media: :obj:`list` of :class:`PaidMedia`
:param gift: Optional. The gift sent to the user by the bot
:type gift: :class:`Gift`
:return: Instance of the class
:rtype: :class:`TransactionPartnerUser`
"""

def __init__(self, type, user, invoice_payload=None, paid_media: Optional[List[PaidMedia]] = None,
subscription_period=None, **kwargs):
subscription_period=None, gift: Optional[Gift] = None, **kwargs):
self.type: str = type
self.user: User = user
self.invoice_payload: Optional[str] = invoice_payload
self.paid_media: Optional[List[PaidMedia]] = paid_media
self.subscription_period: Optional[int] = subscription_period
self.gift: Optional[Gift] = gift

@classmethod
def de_json(cls, json_string):
Expand All @@ -10514,6 +10518,8 @@ def de_json(cls, json_string):
obj['user'] = User.de_json(obj['user'])
if 'paid_media' in obj:
obj['paid_media'] = [PaidMedia.de_json(media) for media in obj['paid_media']]
if 'gift' in obj:
obj['gift'] = Gift.de_json(obj['gift'])
return cls(**obj)


Expand Down Expand Up @@ -11025,7 +11031,7 @@ def de_json(cls, json_string):
obj = cls.check_json(json_string)
return cls(**obj)


class Gift(JsonDeserializable):
"""
This object represents a gift that can be sent by the bot.
Expand Down

0 comments on commit 9c7c47f

Please sign in to comment.