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

Fix issue with thumbnail in InputMedia types #2434

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

hecklawert
Copy link
Contributor

@hecklawert hecklawert commented Dec 9, 2024

Description

  • Fixed an issue where InputFile objects in the thumbnail field caused JSON serialization errors.

  • Modified the function convert_input_media_array to extract InputFile objects from thumbnail and replace them with attach:// references.

Describe your tests

  • Tested with multiple configurations of InputMedia arrays, including videos and images with local files as thumbnail.

  • Verified successful requests to the Telegram API to upload media groups with proper file attachments.

  • Confirmed that JSON serialization no longer fails when InputFile is present.

Python version:
3.12

OS:
Debian 12

Checklist:

  • I added/edited example on new feature/change (if exists)
  • My changes won't break backward compatibility
  • I made changes both for sync and async

Related to #2429

@Badiboy
Copy link
Collaborator

Badiboy commented Dec 9, 2024

I have nothing against this PR, but cannot confirm if it is right or not.
@coder2020official May be you can?

@coder2020official
Copy link
Collaborator

Hi, sorry took me a while to write this comment. This change looks reasonable, however, you haven't made changes for the async version. Could you do that as well?

@hecklawert
Copy link
Contributor Author

hecklawert commented Dec 12, 2024

@coder2020official Hi, sorry. I thought the changes made were also intended for the asynchronous version. I have made the corrections, but please be aware that I am currently unable to test with the asynchronous version.

@Badiboy Badiboy merged commit 0f520d6 into eternnoir:master Dec 12, 2024
7 checks passed
@Badiboy
Copy link
Collaborator

Badiboy commented Dec 12, 2024

Looks fine. Thank you.

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.

3 participants