KeyboardButtonRequestUsers

class telegram.KeyboardButtonRequestUsers(request_id, user_is_bot=None, user_is_premium=None, max_quantity=None, request_name=None, request_username=None, request_photo=None, *, api_kwargs=None)[source]

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. More about requesting users ».

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

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

    Added in version 20.8.

  • request_name (bool, optional) –

    Pass True to request the users’ first and last name.

    Added in version 21.1.

  • request_username (bool, optional) –

    Pass True to request the users’ username.

    Added in version 21.1.

  • request_photo (bool, optional) –

    Pass True to request the users’ photo.

    Added in version 21.1.

request_id[source]

Identifier of the request.

Type:

int

user_is_bot[source]

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[source]

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[source]

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

Added in version 20.8.

Type:

int

request_name[source]

Optional. Pass True to request the users’ first and last name.

Added in version 21.1.

Type:

bool

request_username[source]

Optional. Pass True to request the users’ username.

Added in version 21.1.

Type:

bool

request_photo[source]

Optional. Pass True to request the users’ photo.

Added in version 21.1.

Type:

bool