TransactionPartner

class telegram.TransactionPartner(type, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of:

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their type is equal.

Added in version 21.4.

..versionchanged:: 21.11

Added TransactionPartnerChat

Parameters:

type (str) – The type of the transaction partner.

type[source]

The type of the transaction partner.

Type:

str

AFFILIATE_PROGRAM = 'affiliate_program'[source]

telegram.constants.TransactionPartnerType.AFFILIATE_PROGRAM

Added in version 21.9.

CHAT = 'chat'[source]

telegram.constants.TransactionPartnerType.CHAT

Added in version 21.11.

FRAGMENT = 'fragment'[source]

telegram.constants.TransactionPartnerType.FRAGMENT

OTHER = 'other'[source]

telegram.constants.TransactionPartnerType.OTHER

TELEGRAM_ADS = 'telegram_ads'[source]

telegram.constants.TransactionPartnerType.TELEGRAM_ADS

TELEGRAM_API = 'telegram_api'[source]

telegram.constants.TransactionPartnerType.TELEGRAM_API

USER = 'user'[source]

telegram.constants.TransactionPartnerType.USER

__dir__()[source]

Default dir() implementation.

__format__(format_spec, /)[source]

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)[source]

Return self>=value.

__getattribute__(name, /)[source]

Return getattr(self, name).

__gt__(value, /)[source]

Return self>value.

classmethod __init_subclass__()[source]

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)[source]

Return self<=value.

__lt__(value, /)[source]

Return self<value.

__ne__(value, /)[source]

Return self!=value.

classmethod __new__(*args, **kwargs)[source]
__reduce__()[source]

Helper for pickle.

__reduce_ex__(protocol, /)[source]

Helper for pickle.

__sizeof__()[source]

Size of object in memory, in bytes.

__str__()[source]

Return str(self).

classmethod __subclasshook__(object, /)[source]

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

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

Converts JSON data to the appropriate TransactionPartner object, i.e. takes care of selecting the correct subclass.

Parameters:
Returns:

The Telegram object.