Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# MenuButtonWebApp

class telegram.MenuButtonWebApp(text, web_app, *, api_kwargs=None)

  Bases: `telegram.MenuButton`

  Represents a menu button, which launches a Web App.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `type`, `text` and `web_app` are equal.

  Use In

  `telegram.Bot.set_chat_menu_button()`

  Returned In

  `telegram.Bot.get_chat_menu_button()`

  New in version 20.0.

  Parameters:

    - text (`str`) – Text of the button.

    - web_app (`telegram.WebAppInfo`) – Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method `answerWebAppQuery()` of `Bot`.

  type

    `'web_app'`.

    Type:

      `str`

  text

    Text of the button.

    Type:

      `str`

  web_app

    Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method `answerWebAppQuery()` of `Bot`.

    Type:

      `telegram.WebAppInfo`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json()`.