mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Update documentation for send_invoice and LabeledPrice
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
c8d2c6a152
commit
83543da3e6
2 changed files with 15 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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__(
|
||||
|
|
|
|||
Loading…
Reference in a new issue