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

# MessageReactionUpdated

class telegram.MessageReactionUpdated(chat, message_id, date, old_reaction, new_reaction, user=None, actor_chat=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This class represents a change of a reaction on a message performed by a user.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if the `chat`, `message_id`, `date`, `old_reaction` and `new_reaction` is equal.

  Available In

  `telegram.Update.message_reaction`

  New in version 20.8.

  Parameters:

    - chat (`telegram.Chat`) – The chat containing the message.

    - message_id (`int`) – Unique message identifier inside the chat.

    - date (`datetime.datetime`) – Date of the change in Unix time. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    - old_reaction (Sequence[`telegram.ReactionType`]) – Previous list of reaction types that were set by the user.

    - new_reaction (Sequence[`telegram.ReactionType`]) – New list of reaction types that were set by the user.

    - user (`telegram.User`, optional) – The user that changed the reaction, if the user isn’t anonymous.

    - actor_chat (`telegram.Chat`, optional) – The chat on behalf of which the reaction was changed, if the user is anonymous.

  chat

    The chat containing the message.

    Type:

      `telegram.Chat`

  message_id

    Unique message identifier inside the chat.

    Type:

      `int`

  date

    Date of the change in Unix time. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`

  old_reaction

    Previous list of reaction types that were set by the user.

    Type:

      Tuple[`telegram.ReactionType`]

  new_reaction

    New list of reaction types that were set by the user.

    Type:

      Tuple[`telegram.ReactionType`]

  user

    Optional. The user that changed the reaction, if the user isn’t anonymous.

    Type:

      `telegram.User`

  actor_chat

    Optional. The chat on behalf of which the reaction was changed, if the user is anonymous.

    Type:

      `telegram.Chat`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json()`.