Skip to content
Back to top
View this page

# DirectMessagesTopic

class telegram.DirectMessagesTopic(topic_id, user=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This class represents a topic for direct messages in a chat.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `topic_id` and `user` is equal.

  Available In

  `telegram.Message.direct_messages_topic`

  Added in version 22.4.

  Parameters:

    - topic_id (`int`) – Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

    - user (`telegram.User`, optional) –

      Information about the user that created the topic.

      Hint

      According to Telegram, this field is always present as of Bot API 9.2.

  topic_id

    Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

    Type:

      `int`

  user

    Optional. Information about the user that created the topic.

    Hint

    According to Telegram, this field is always present as of Bot API 9.2.

    Type:

      `telegram.User`

  classmethod de_json(data, bot=None)

    See `telegram.TelegramObject.de_json()`.