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

sendDocument thumbnail parameter is not working correctly as per my expectation #630

Open
SpEcHiDe opened this issue Aug 23, 2024 · 0 comments

Comments

@SpEcHiDe
Copy link

SpEcHiDe commented Aug 23, 2024

  1. use sendDocument API with document and thumbnail parameter set.
curl -i "https://api.telegram.org/botTOKEN/sendDocument" -F "chat_id=CHAT_ID" -F "document=@file_example_WEBM_1920_3_7MB.webm" -F "[email protected]"
{
    "ok": true,
    "result": {
        "message_id": 1781334,
        "from": {},
        "chat": {},
        "date": 1724255401,
        "document": {
            "file_name": "file_example_WEBM_1920_3_7MB.webm",
            "mime_type": "video/webm",
            "thumbnail": {
                "file_id": "AAMCBQADGQMAARsuVmbGDKl90qUpBhvQ_OFUyK7u91A5AAIbEAACmTAxVmu7N9lyvqdpAQAHbQADNQQ",
                "file_unique_id": "AQADGxAAApkwMVZy",
                "file_size": 16541,
                "width": 320,
                "height": 320
            },
            "file_id": "BQACAgUAAxkDAAEbLlZmxgypfdKlKQYb0PzhVMiu7vdQOQACGxAAApkwMVZruzfZcr6naTUE",
            "file_unique_id": "AgADGxAAApkwMVY",
            "file_size": 3667214
        }
    }
}
curl -i "https://api.telegram.org/botTOKEN/sendDocument" -F "chat_id=CHAT_ID" -F "document=@sample_960x540.m4v" -F "[email protected]"

Actual Result

for WEBM documents, thumbnail is present in the sendDocument response, but absent in the original message which is verified by forwarding the media to Telegram JSON Bot.

WEBM document

M4V document

Expected Result

the thumbnail is set correctly on the media irrespective of the document passed to the API

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