Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# UsersShared

class telegram.UsersShared(request_id, users, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object contains information about the user whose identifier was shared with the bot using a `telegram.KeyboardButtonRequestUsers` button.

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

  Available In

  `telegram.Message.users_shared`

  Added in version 20.8: Bot API 7.0 replaces `UserShared` with this class. The only difference is that now the `user_ids` is a sequence instead of a single integer.

  Changed in version 21.1: The argument `users` is now considered for the equality comparison instead of `user_ids`.

  Removed in version 21.2: Removed the deprecated argument and attribute `user_ids`.

  Parameters:

    - request_id (`int`) – Identifier of the request.

    - users (Sequence[`telegram.SharedUser`]) –

      Information about users shared with the bot.

      Added in version 21.1.

      Changed in version 21.2: This argument is now required.

  request_id

    Identifier of the request.

    Type:

      `int`

  users

    Information about users shared with the bot.

    Added in version 21.1.

    Type:

      tuple[`telegram.SharedUser`]

  classmethod de_json(data, bot=None)

    See `telegram.TelegramObject.de_json()`.