@@ -261,7 +261,7 @@ def load_reply_handlers(self, filename="./.handler-saves/reply.save", del_file_a
261261 self .reply_backend .load_handlers (filename , del_file_after_loading )
262262
263263 def set_webhook (self , url = None , certificate = None , max_connections = None , allowed_updates = None , ip_address = None ,
264- drop_pending_updates = None , timeout = None ):
264+ drop_pending_updates = None , timeout = None , secret_token = None ):
265265 """
266266 Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an
267267 update for the bot, we will send an HTTPS POST request to the specified url,
@@ -286,10 +286,11 @@ def set_webhook(self, url=None, certificate=None, max_connections=None, allowed_
286286 resolved through DNS
287287 :param drop_pending_updates: Pass True to drop all pending updates
288288 :param timeout: Integer. Request connection timeout
289+ :param secret_token: Secret token to be used to verify the webhook request.
289290 :return: API reply.
290291 """
291292 return apihelper .set_webhook (self .token , url , certificate , max_connections , allowed_updates , ip_address ,
292- drop_pending_updates , timeout )
293+ drop_pending_updates , timeout , secret_token )
293294
294295 def delete_webhook (self , drop_pending_updates = None , timeout = None ):
295296 """
@@ -2462,6 +2463,69 @@ def send_invoice(
24622463 max_tip_amount , suggested_tip_amounts , protect_content )
24632464 return types .Message .de_json (result )
24642465
2466+
2467+ def create_invoice_link (self ,
2468+ title : str , description : str , payload :str , provider_token : str ,
2469+ currency : str , prices : List [types .LabeledPrice ],
2470+ max_tip_amount : Optional [int ] = None ,
2471+ suggested_tip_amounts : Optional [List [int ]]= None ,
2472+ provider_data : Optional [str ]= None ,
2473+ photo_url : Optional [str ]= None ,
2474+ photo_size : Optional [int ]= None ,
2475+ photo_width : Optional [int ]= None ,
2476+ photo_height : Optional [int ]= None ,
2477+ need_name : Optional [bool ]= None ,
2478+ need_phone_number : Optional [bool ]= None ,
2479+ need_email : Optional [bool ]= None ,
2480+ need_shipping_address : Optional [bool ]= None ,
2481+ send_phone_number_to_provider : Optional [bool ]= None ,
2482+ send_email_to_provider : Optional [bool ]= None ,
2483+ is_flexible : Optional [bool ]= None ) -> str :
2484+
2485+ """
2486+ Use this method to create a link for an invoice.
2487+ Returns the created invoice link as String on success.
2488+
2489+ Telegram documentation:
2490+ https://core.telegram.org/bots/api#createinvoicelink
2491+
2492+ :param title: Product name, 1-32 characters
2493+ :param description: Product description, 1-255 characters
2494+ :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user,
2495+ use for your internal processes.
2496+ :param provider_token: Payments provider token, obtained via @Botfather
2497+ :param currency: Three-letter ISO 4217 currency code,
2498+ see https://core.telegram.org/bots/payments#supported-currencies
2499+ :param prices: Price breakdown, a list of components
2500+ (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
2501+ :param max_tip_amount: The maximum accepted amount for tips in the smallest units of the currency
2502+ :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the smallest
2503+ :param provider_data: A JSON-serialized data about the invoice, which will be shared with the payment provider.
2504+ A detailed description of required fields should be provided by the payment provider.
2505+ :param photo_url: URL of the product photo for the invoice. Can be a photo of the goods
2506+ :param photo_size: Photo size in bytes
2507+ :param photo_width: Photo width
2508+ :param photo_height: Photo height
2509+ :param need_name: Pass True, if you require the user's full name to complete the order
2510+ :param need_phone_number: Pass True, if you require the user's phone number to complete the order
2511+ :param need_email: Pass True, if you require the user's email to complete the order
2512+ :param need_shipping_address: Pass True, if you require the user's shipping address to complete the order
2513+ :param send_phone_number_to_provider: Pass True, if user's phone number should be sent to provider
2514+ :param send_email_to_provider: Pass True, if user's email address should be sent to provider
2515+ :param is_flexible: Pass True, if the final price depends on the shipping method
2516+
2517+ :return: Created invoice link as String on success.
2518+ """
2519+ result = apihelper .create_invoice_link (
2520+ self .token , title , description , payload , provider_token ,
2521+ currency , prices , max_tip_amount , suggested_tip_amounts , provider_data ,
2522+ photo_url , photo_size , photo_width , photo_height , need_name , need_phone_number ,
2523+ need_email , need_shipping_address , send_phone_number_to_provider ,
2524+ send_email_to_provider , is_flexible )
2525+ return result
2526+
2527+
2528+
24652529 # noinspection PyShadowingBuiltins
24662530 # TODO: rewrite this method like in API
24672531 def send_poll (
0 commit comments