Skip to content
Back to top
View this page

# ChatShared

class telegram.ChatShared(request_id, chat_id, title=None, username=None, photo=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

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

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

  Available In

  `telegram.Message.chat_shared`

  Added in version 20.1.

  Parameters:

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

    - chat_id (`int`) – Identifier of the shared user. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

    - title (`str`, optional) –

      Title of the chat, if the title was requested by the bot.

      Added in version 21.1.

    - username (`str`, optional) –

      Username of the chat, if the username was requested by the bot and available.

      Added in version 21.1.

    - photo (Sequence[`telegram.PhotoSize`], optional) –

      Available sizes of the chat photo, if the photo was requested by the bot

      Added in version 21.1.

  request_id

    Identifier of the request.

    Type:

      `int`

  chat_id

    Identifier of the shared user. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

    Type:

      `int`

  title

    Optional. Title of the chat, if the title was requested by the bot.

    Added in version 21.1.

    Type:

      `str`

  username

    Optional. Username of the chat, if the username was requested by the bot and available.

    Added in version 21.1.

    Type:

      `str`

  photo

    Optional. Available sizes of the chat photo, if the photo was requested by the bot

    Added in version 21.1.

    Type:

      tuple[`telegram.PhotoSize`]

  classmethod de_json(data, bot=None)

    See `telegram.TelegramObject.de_json()`.

  property link

    Convenience property. If `username` is available, returns a t.me link of the chat.

    Added in version 22.4.

    Type:

      `str`