Skip to content

[QUESTION] AttributeError: '_io.BufferedReader' object has no attribute 'parse_mode' on Bot.edit_message_media #2405

Answered by Bibo-Joshi
GivenFLY asked this question in Q&A
Discussion options

You must be logged in to vote

But doesn't InputMediaPhoto inherit from InputMedia?

yes. that's the point ;)

In my case I can't simply use message.edit_media. I need to change a picture using message_id

As per the docs I pointed you to, message.edit_media(**kwargs) is equivalent to bot.edit_message_media(chat_id=message.chat_id, message_id=message.message_id, **kwargs)

Even if I use message.edit_media it shows me same exceprion

because you still pass an open file instead of an InputMediaPhoto instance ;)

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@GivenFLY
Comment options

@Bibo-Joshi
Comment options

@GivenFLY
Comment options

Answer selected by GivenFLY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2403 on February 28, 2021 23:08.