mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14: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``):
|
currency (``str``):
|
||||||
Three-letter ISO 4217 currency code.
|
Three-letter ISO 4217 currency code.
|
||||||
|
`XTR` for Telegram Stars.
|
||||||
|
|
||||||
prices (List of :obj:`~pyrogram.types.LabeledPrice`):
|
prices (List of :obj:`~pyrogram.types.LabeledPrice`):
|
||||||
Price with label.
|
Price with label.
|
||||||
|
|
||||||
provider (``str``, *optional*):
|
provider (``str``, *optional*):
|
||||||
Payment provider.
|
Payment provider.
|
||||||
|
Get this from botfather.
|
||||||
|
|
||||||
provider_data (``str``, *optional*):
|
provider_data (``str``, *optional*):
|
||||||
Provider data in json format.
|
Provider data in json format.
|
||||||
|
|
@ -106,14 +108,23 @@ class SendInvoice:
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
# USD
|
||||||
app.send_invoice(chat_id, types.InputMediaInvoice(
|
app.send_invoice(chat_id, types.InputMediaInvoice(
|
||||||
title="Product Name",
|
title="Product Name",
|
||||||
description="Product Description",
|
description="Product Description",
|
||||||
currency="USD",
|
currency="USD",
|
||||||
prices=[types.LabeledPrice("Product", 1000)],
|
prices=[types.LabeledPrice("Product", 1000)],
|
||||||
provider="Stripe",
|
provider="Stripe_provider_codes",
|
||||||
provider_data="{}"
|
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:
|
if reply_markup is not None:
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ class LabeledPrice(Object):
|
||||||
|
|
||||||
amount (``int``):
|
amount (``int``):
|
||||||
Price of the product in the smallest units of the currency (integer, not float/double).
|
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__(
|
def __init__(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue