send_payment_form()

Client.send_payment_form()

Pay an invoice.

Note

For now only stars invoices are supported.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. Unique identifier for the target chat in form of a t.me/joinchat/ link, identifier (int) or username of the target channel/supergroup (in the format @username).

  • message_id (int | str) – Pass a message identifier or to get the invoice from message. Pass a invoice link in form of a t.me/$… link or slug itself to get the payment form from link.

Returns:

bool – On success, True is returned.

Example

# Pay invoice from message
app.send_payment_form(chat_id, 123)

# Pay invoice form from link
# Chat id can be None
app.send_payment_form(chat_id, "https://t.me/$xvbzUtt5sUlJCAAATqZrWRy9Yzk")