Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
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`

  Added 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.

      Added 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.

      Added 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.

      Added 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.

    Added 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.

    Added 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.

    Added in version 20.6.

    Type:

      `bool`