diff --git a/pyrogram/methods/messages/send_invoice.py b/pyrogram/methods/messages/send_invoice.py index ce72bdcf..46579dd1 100644 --- a/pyrogram/methods/messages/send_invoice.py +++ b/pyrogram/methods/messages/send_invoice.py @@ -57,12 +57,14 @@ class SendInvoice: currency (``str``): Three-letter ISO 4217 currency code. + `XTR` for Telegram Stars. prices (List of :obj:`~pyrogram.types.LabeledPrice`): Price with label. provider (``str``, *optional*): Payment provider. + Get this from botfather. provider_data (``str``, *optional*): Provider data in json format. @@ -106,14 +108,23 @@ class SendInvoice: Example: .. code-block:: python + # USD app.send_invoice(chat_id, types.InputMediaInvoice( title="Product Name", description="Product Description", currency="USD", prices=[types.LabeledPrice("Product", 1000)], - provider="Stripe", + provider="Stripe_provider_codes", provider_data="{}" )) + + # Telegram Stars + app.send_invoice(chat_id, types.InputMediaInvoice( + title="Product Name", + description="Product Description", + currency="XTR", + prices=[types.LabeledPrice("Product", 1000)] + )) """ if reply_markup is not None: diff --git a/pyrogram/types/messages_and_media/labeled_price.py b/pyrogram/types/messages_and_media/labeled_price.py index 5ffc9237..5ea1c53c 100644 --- a/pyrogram/types/messages_and_media/labeled_price.py +++ b/pyrogram/types/messages_and_media/labeled_price.py @@ -28,6 +28,9 @@ class LabeledPrice(Object): amount (``int``): Price of the product in the smallest units of the currency (integer, not float/double). + The minimum amuont for telegram stars is 1. + The minimum amount for other currencies is US$1. + you need to add 2 extra zeros to the amount (except stars), example 100 for 1 usd. """ def __init__(