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

# KeyboardButtonRequestUsers

class telegram.KeyboardButtonRequestUsers(request_id, user_is_bot=None, user_is_premium=None, max_quantity=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.

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

  Available In

  `telegram.KeyboardButton.request_users`

  See also

  Telegram Docs on requesting users

  New in version 20.8: This class was previously named `KeyboardButtonRequestUser`.

  Parameters:

    - request_id (`int`) – Signed 32-bit identifier of the request, which will be received back in the `telegram.UsersShared` object. Must be unique within the message.

    - user_is_bot (`bool`, optional) – Pass `True` to request a bot, pass `False` to request a regular user. If not specified, no additional restrictions are applied.

    - user_is_premium (`bool`, optional) – Pass `True` to request a premium user, pass `False` to request a non-premium user. If not specified, no additional restrictions are applied.

    - max_quantity (`int`, optional) –

      The maximum number of users to be selected; `1` - `10`. Defaults to `1` .

      New in version 20.8.

  request_id

    Identifier of the request.

    Type:

      `int`

  user_is_bot

    Optional. Pass `True` to request a bot, pass `False` to request a regular user. If not specified, no additional restrictions are applied.

    Type:

      `bool`

  user_is_premium

    Optional. Pass `True` to request a premium user, pass `False` to request a non-premium user. If not specified, no additional restrictions are applied.

    Type:

      `bool`

  max_quantity

    Optional. The maximum number of users to be selected; `1` - `10`. Defaults to `1` .

    New in version 20.8.

    Type:

      `int`