Skip to content

Convenient send methods #731

@jsmnbom

Description

@jsmnbom

Currently our send_* methods can accept either a string or an InputFile (filelike object really). This means that if I wanna for example resend a photo that got send to the bot I can do:

photo = update.message.photo
bot.send_photo(chat_id, photo.file_id)

I'm suggesting we add so it's possible to just do:

photo = update.message.photo
bot.send_photo(chat_id, photo)

So it's possible to send a photo that the bot has received very simply.

If we wanted to take this one step further (which I believe could be pretty cool, we can add a generic send method so something like this would work:

photo = update.message.photo
bot.send(chat_id, photo)

And it would automagically figure out the type of the 2nd argument and send it as such.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions