StarTransaction¶
- class telegram.StarTransaction(id, amount, date, source=None, receiver=None, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectDescribes a Telegram Star transaction.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
id,source, andreceiverare equal.Available In
Added in version 21.4.
- Parameters:
id (
str) – Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides withSuccessfulPayment.telegram_payment_charge_idfor successful incoming payments from users.amount (
int) – Number of Telegram Stars transferred by the transaction.date (
datetime.datetime) – Date the transaction was created as a datetime object.source (
telegram.TransactionPartner, optional) – Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.receiver (
telegram.TransactionPartner, optional) – Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
- id[source]¶
Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with
SuccessfulPayment.telegram_payment_charge_idfor successful incoming payments from users.- Type:
str
- source[source]¶
Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.
- receiver[source]¶
Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
- classmethod de_json(data, bot=None)[source]¶
Converts JSON data to a Telegram object.
- Parameters:
data (Dict[
str, …]) – The JSON data.bot (
telegram.Bot, optional) –The bot associated with this object. Defaults to
None, in which case shortcut methods will not be available.Changed in version 21.4:
botis now optional and defaults toNone
- Returns:
The Telegram object.