You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pyrogram/methods/bots/create_invoice_link.py
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,11 @@
16
16
# You should have received a copy of the GNU Lesser General Public License
17
17
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18
18
19
+
fromdatetimeimportdatetime
19
20
fromtypingimportUnion, List, Optional
20
21
21
22
importpyrogram
22
-
frompyrogramimportraw, types
23
+
frompyrogramimportutils, raw, types
23
24
24
25
25
26
classCreateInvoiceLink:
@@ -31,6 +32,7 @@ async def create_invoice_link(
31
32
currency: str,
32
33
prices: List["types.LabeledPrice"],
33
34
provider_token: Optional[str] =None,
35
+
subscription_period: datetime=None,
34
36
max_tip_amount: Optional[int] =None,
35
37
suggested_tip_amounts: Optional[List[int]] =None,
36
38
start_parameter: Optional[str] =None,
@@ -73,6 +75,11 @@ async def create_invoice_link(
73
75
provider_token (``str``, *optional*):
74
76
Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
The number of seconds the subscription will be active for before the next payment.
80
+
The currency must be set to “XTR” (Telegram Stars) if the parameter is used.
81
+
Currently, it must always be 2592000 (30 days) if specified.
82
+
76
83
max_tip_amount (``int``, *optional*):
77
84
The maximum accepted amount for tips in the smallest units of the currency (integer, **not** float/double). For example, for a maximum tip of ``US$ 1.45`` pass ``max_tip_amount = 145``. See the exp parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
0 commit comments