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

Enable sending file contents in editMessageMedia #99

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

versilov
Copy link
Contributor

@versilov versilov commented Feb 3, 2023

Like this: ExGram.editMessageMedia(%InputMedia{type: "photo", media: "attach://file"}, file: {:file_contents, <<>>, "img.gif"}, ...)

This is a quick fix.
It would be nice to be able to do ExGram.editMessageMedia(%InputMedia{type: "photo", media: {:file_contents, <<>>, "img.gif"}}, ...) finally

Like this:
```
ExGram.editMessageMedia(%InputMedia{type: "photo", media: "attach://file"}, file: {:file_contents, <<>>, "img.gif"})
```
@rockneurotiko
Copy link
Owner

I think that it's better to use the media field as a File, and change the code here to change the field accordingly and maybe add the new one for multipart upload (https://core.telegram.org/bots/api#inputmediaphoto)

This change would need changes on the API parser + code generator (https://github.com/rockneurotiko/telegram_api_json) in order to change the type on the auto generated models, and changes in this project to understand the media field and change it accordingly

But I think it's needed, I will take a look for sure

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

Successfully merging this pull request may close these issues.

2 participants