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

Allow to send any type of file with InlineQueryResultDocument #644

Open
Sarisan opened this issue Oct 3, 2024 · 2 comments
Open

Allow to send any type of file with InlineQueryResultDocument #644

Sarisan opened this issue Oct 3, 2024 · 2 comments

Comments

@Sarisan
Copy link

Sarisan commented Oct 3, 2024

It is not officially supported by Bot API yet, but you can actually put any file like PNG there and set mine type to zip. It will be sent and displayed properly in any client, except for the moment when file is being downloaded by Telegram server, it will show it as file.zip during download. Can all other mime types like gif, png, jpg, mp4, webm, webp and other popular ones be supported too?

@levlam
Copy link
Contributor

levlam commented Oct 3, 2024

It can't be supported now. Inline mode isn't different from sending files by URL on behalf of the user. It works by downloading content of the specified URL server-side and using it as message content. The content of the URL must uniquely determine the type of the message. PNG and JPG files are treated as photos and therefore can be used only for InlineQueryResultPhoto.

@Sarisan
Copy link
Author

Sarisan commented Oct 6, 2024

PNG and JPG files are treated as photos and therefore can be used only for InlineQueryResultPhoto.

In this case they are supposed to be sent as files, original files, not compressed photos.
I just noticed that official API reference tells that sendDocument is also valid for GIF, PDF and ZIP only, while in reality it can be used with absolutely any other type of file.

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

2 participants