Skip to content

[FEATURE] Add convenience property id to Message #3075

@harshil21

Description

@harshil21

Current situation

Telegram currently offers attribute message_id to Message. But this is inconsistent with the rest of their API, e.g. Chat.id, User.id, InlineQuery.id, etc. We can offer a convenience property Message.id which will make it more consistent and make it less prone to errors, e.g. when someone forgets it's message_id and not id.

Proposed change

Add the property id to Message which just returns self.message_id. A similar example can be found here.

A PR for this issue should

  • Add a docstring along with a .. versionadded:: 20.0 directive to the function.
  • Add an unit test to test_message.py that ensures that this works as expected and is the same as Message.message_id.

Additional Info

We have a contribution guide

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions