KeyboardButtonRequestUser

class telegram.KeyboardButtonRequestUser(request_id, user_is_bot=None, user_is_premium=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.

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

New in version 20.1.

Parameters:
  • request_id (int) – Signed 32-bit identifier of the request, which will be received back in the telegram.UserShared 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.

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