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

# WebAppData

class telegram.WebAppData(data, button_text, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  Contains data sent from a Web App to the bot.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `data` and `button_text` are equal.

  Examples

  Webapp Bot

  Available In

  `telegram.Message.web_app_data`

  New in version 20.0.

  Parameters:

    - data (`str`) – The data. Be aware that a bad client can send arbitrary data in this field.

    - button_text (`str`) – Text of the `web_app` keyboard button, from which the Web App was opened.

  data

    The data. Be aware that a bad client can send arbitrary data in this field.

    Type:

      `str`

  button_text

    Text of the `web_app` keyboard button, from which the Web App was opened.

    Warning

    Be aware that a bad client can send arbitrary data in this field.

    Type:

      `str`