open_web_app()

Client.open_web_app()

Informs pyrogram that a Web App is being opened from the attachment menu, a MenuButton, an url, or an InlineKeyboardButton button.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • bot_user_id (int | str) – Unique identifier (int) or username (str) of the target bot.

  • url (str, optional) – The URL from an InlineKeyboardButton or a MenuButton.

  • message_thread_id (int, optional) – If not None, the message thread identifier to which the message will be sent.

  • direct_messages_topic_id (int, optional) – If not None, unique identifier of the topic of channel direct messages chat to which the message will be sent.

  • reply_parameters (ReplyParameters, optional) – Information about the message or story to be replied in the message sent by the Web App.

  • platform (ClientPlatform, optional) – The platform on which the link will be opened.

Returns:

str – On success, returns the url of a Web App.

Example

link = await app.open_web_app(chat_id, bot_user_id)