accept_url_auth()

async Client.accept_url_auth()

Accept URL authorization (login via Telegram for a website).

Usable by Users Bots
Parameters:
  • url (str) – The URL to accept authorization for.

  • write_allowed (bool, optional) – If True, allow the bot to send messages.

  • share_phone_number (bool, optional) – If True, share your phone number with the bot.

  • chat_id (int | str, optional) – Chat containing the inline keyboard button.

  • message_id (int, optional) – The message with the button.

  • button_id (int, optional) – The button ID.

  • match_code (str, optional) – URL match code.

Returns:

UrlAuthResult – The URL auth result with the authorized URL.

Example

result = await app.accept_url_auth(url="https://example.com", write_allowed=True)