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

# WriteAccessAllowed

class telegram.WriteAccessAllowed(web_app_name=None, from_request=None, from_attachment_menu=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `web_app_name` is equal.

  Available In

  `telegram.Message.write_access_allowed`

  New in version 20.0.

  Changed in version 20.6: Added custom equality comparison for objects of this class.

  Parameters:

    - web_app_name (`str`, optional) –

      Name of the Web App, if the access was granted when the Web App was launched from a link.

      New in version 20.3.

    - from_request (`bool`, optional) –

      `True`, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess.

      New in version 20.6.

    - from_attachment_menu (`bool`, optional) –

      `True`, if the access was granted when the bot was added to the attachment or side menu.

      New in version 20.6.

  web_app_name

    Optional. Name of the Web App, if the access was granted when the Web App was launched from a link.

    New in version 20.3.

    Type:

      `str`

  from_request

    Optional. `True`, if the access was granted after the user accepted an explicit request from a Web App.

    New in version 20.6.

    Type:

      `bool`

  from_attachment_menu

    Optional. `True`, if the access was granted when the bot was added to the attachment or side menu.

    New in version 20.6.

    Type:

      `bool`