Skip to content

[FEATURE] MessageReactionHandler returning message content #4506

@zmn-hamid

Description

@zmn-hamid

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

telegram.ext.messagereactionhandler doesn't actually return the message itself, only the message_id (and we don't have any Bot.get_message function either). If we can't see what's the message that has been reacted to, this handler is quite useless

Describe the solution you'd like

update.message or context.effective_message should be the exact message that has been replied to, including all of it's data (such as inline keyboard)

Describe alternatives you've considered

There's no alternative feature but at least a Bot.get_message would help.

Additional context

Current output of update.to_dict() when a user reacts to a message:

{
  "message_reaction": {
    "chat": {
      "first_name": "NAME",
      "id": USER_ID,
      "type": "private",        
      "username": "USERNAME"   
    },
    "date": 1727549399,
    "message_id": 19456,        
    "new_reaction": [
      {
        "emoji": "❤",
        "type": "emoji"
      }
    ],
    "user": {
      "first_name": "NAME",
      "id": USER_ID,
      "is_bot": false,
      "language_code": "en",
      "username": "USERNAME"
    }
  },
  "update_id": 980133295
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions