TransactionPartnerUser

class telegram.TransactionPartnerUser(transaction_type, user, invoice_payload=None, paid_media=None, paid_media_payload=None, subscription_period=None, gift=None, affiliate=None, premium_subscription_duration=None, *, api_kwargs=None)[source]

Bases: telegram.TransactionPartner

Describes a transaction with a user.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their user and transaction_type are equal.

Added in version 21.4.

Changed in version 22.1: Equality comparison now includes the new required argument transaction_type, introduced in Bot API 9.0.

Parameters:
type[source]

The type of the transaction partner, always 'user'.

Type:

str

transaction_type[source]

Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts.

Added in version 22.1.

Type:

str

user[source]

Information about the user.

Type:

telegram.User

affiliate[source]

Optional. Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.

Added in version 21.9.

Type:

telegram.AffiliateInfo

invoice_payload[source]

Optional. Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.

Type:

str

subscription_period[source]

Optional. The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.

Added in version 21.8.

Type:

datetime.timedelta

paid_media[source]

Optional. Information about the paid media bought by the user. for 'paid_media_payment' transactions only.

Added in version 21.5.

Type:

tuple[telegram.PaidMedia]

paid_media_payload[source]

Optional. Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.

Added in version 21.6.

Type:

str

gift[source]

Optional. The gift sent to the user by the bot; for 'gift_purchase' transactions only.

Added in version 21.8.

Type:

telegram.Gift

premium_subscription_duration[source]

Optional. Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only.

Added in version 22.1.

Type:

int

classmethod de_json(data, bot=None)[source]

See telegram.TransactionPartner.de_json().