Skip to content

Clarify Documentation and Type Hints of Input(Paid)Media #4762

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

Merged
merged 4 commits into from
Apr 20, 2025

Conversation

Bibo-Joshi
Copy link
Member

See https://t.me/pythontelegrambotgroup/777286

Not adding any versionchanged directives, since passing other things than str and InputFile never worked.

@Bibo-Joshi Bibo-Joshi added ⚙️ documentation affected functionality: documentation ⚙️ type-hinting affected functionality: type-hinting labels Apr 19, 2025
Copy link
Member

@aelkheir aelkheir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. Can confirm passing bytes directly to Input(Paid)Media doesn't work.
at a pinch one can still pass bytes through InputFile.

input_media = InputMedia(
        media_type=InputMediaType.PHOTO,
        media=InputFile(some_bytes, attach=True),
)

await context.bot.edit_message_media(
        chat_id=update.effective_chat.id,
        message_id=update.message.id,
        media=input_media,
)

PS: just a forgotten | :)

@Bibo-Joshi Bibo-Joshi merged commit 486ceaa into master Apr 20, 2025
39 of 42 checks passed
@Bibo-Joshi Bibo-Joshi deleted the fix-inputmedia-docs/annotations branch April 20, 2025 08:48
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ documentation affected functionality: documentation ⚙️ type-hinting affected functionality: type-hinting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants