Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add message.file_id #13

Open
KnorpelSenf opened this issue Dec 31, 2024 · 0 comments
Open

feat: add message.file_id #13

KnorpelSenf opened this issue Dec 31, 2024 · 0 comments

Comments

@KnorpelSenf
Copy link
Member

When a file is sent, the server may change the type of message after it was sent. For example, ctx.send({ video }) might end up returning a document message with message.document.file_id being the file identifier of the uploaded file. It isn't known which type of message we will receive, so it is tedious to check all different types of messages every time in order to obtain the file identifier.

We should hydrate API call results and install message.file_id on the resulting message object. It should be an alias for getting the file identifier from many different places.

For consistency, we should also do this for incoming messages—otherwise people will be confused why some message objects have this property and some don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant