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

# UsersShared

class telegram.UsersShared(request_id, user_ids, *, 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 `user_ids` are equal.

  Available In

  `telegram.Message.users_shared`

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

  Parameters:

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

    - user_ids (Sequence[`int`]) – Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.

  request_id

    Identifier of the request.

    Type:

      `int`

  user_ids

    Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.

    Type:

      Tuple[`int`]