Answer the question
In order to leave comments, you need to log in
How to push a photo into a telegram bot variable and use it in the future?
Problem - I'm creating a telegram bot for the marketplace. That is, the user fills out an application, after which his application is sent to the tg channel. It should also include photographs. But not the point. Text variables, by city type, name, etc. I did, but I can’t put a photo in any way, I’m too young in this matter. I am programming in Python, I use pyTelegramBotAPI, please help, I will answer all questions.
Answer the question
In order to leave comments, you need to log in
Have you looked at the official documentation?
https://pypi.org/project/pyTelegramBotAPI/
# All send_xyz functions which can take a file as an argument, can also take a file_id instead of a file.
# sendPhoto
photo = open('/tmp/photo.png', 'rb')
tb.send_photo(chat_id, photo)
tb.send_photo(chat_id, "FILEID")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question