Answer the question
In order to leave comments, you need to log in
You need to send a photo to the user of the bot. How to do it right?
I am writing a bot and I need to send a photo. I looked at how to upload a photo and send it by file_id. Those. I upload a photo to the bot and in the browser I get a file_id (api.telegram.org/bot/getupdates. Yes, stupid. I'm a newbie. Especially now it doesn't send me a photo ID at all). You need to upload a lot of photos. How else can I send a photo? just from the folder with the bot? Or maybe you can store photos in the database (maybe I wrote stupidity)? Who can tell? Thank you.
Answer the question
In order to leave comments, you need to log in
Hello, I advise - https://github.com/eternnoir/pyTelegramBotAPI
the simplest example:
# sendPhoto
photo = open('/tmp/photo.png', 'rb')
tb.send_photo(chat_id, photo)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question