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.TransactionPartnerDescribes 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
userandtransaction_typeare 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:
transaction_type (
str) –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.
user (
telegram.User) – Information about the user.affiliate (
telegram.AffiliateInfo, 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.
invoice_payload (
str, optional) – Bot-specified invoice payload. Can be available only for'invoice_payment'transactions.subscription_period (
int|datetime.timedelta, optional) –The duration of the paid subscription. Can be available only for
'invoice_payment'transactions.Added in version 21.8.
Changed in version v22.2: Accepts
intobjects as well asdatetime.timedelta.paid_media (Sequence[
telegram.PaidMedia], optional) –Information about the paid media bought by the user. for
'paid_media_payment'transactions only.Added in version 21.5.
paid_media_payload (
str, optional) –Bot-specified paid media payload. Can be available only for
'paid_media_payment'transactions.Added in version 21.6.
gift (
telegram.Gift, optional) –The gift sent to the user by the bot; for
'gift_purchase'transactions only.Added in version 21.8.
premium_subscription_duration (
int, optional) –Number of months the gifted Telegram Premium subscription will be active for; for
'premium_purchase'transactions only.Added in version 22.1.
- 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
- 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:
- 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:
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