MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / LabeledPrice

Class LabeledPrice

telebot/types.py:6505–6532  ·  view source on GitHub ↗

This object represents a portion of the price for goods or services. Telegram Documentation: https://core.telegram.org/bots/api#labeledprice :param label: Portion label :type label: :obj:`str` :param amount: Price of the product in the smallest units of the currency (integer,

Source from the content-addressed store, hash-verified

6503# Payments
6504
6505class LabeledPrice(JsonSerializable, Dictionaryable):
6506 """
6507 This object represents a portion of the price for goods or services.
6508
6509 Telegram Documentation: https://core.telegram.org/bots/api#labeledprice
6510
6511 :param label: Portion label
6512 :type label: :obj:`str`
6513
6514 :param amount: Price of the product in the smallest units of the currency (integer, not float/double). For example,
6515 for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past
6516 the decimal point for each currency (2 for the majority of currencies).
6517 :type amount: :obj:`int`
6518
6519 :return: Instance of the class
6520 :rtype: :class:`telebot.types.LabeledPrice`
6521 """
6522 def __init__(self, label, amount):
6523 self.label: str = label
6524 self.amount: int = amount
6525
6526 def to_dict(self):
6527 return {
6528 'label': self.label, 'amount': self.amount
6529 }
6530
6531 def to_json(self):
6532 return json.dumps(self.to_dict())
6533
6534
6535class Invoice(JsonDeserializable):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…