pyrofork: Update documentation for send_invoice and LabeledPrice

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-07-06 14:43:58 +07:00
parent c8d2c6a152
commit 83543da3e6
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 15 additions and 1 deletions

View file

@ -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:

View file

@ -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__(