Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python save image pytelegrambotapi

@bot.message_handler(content_types=['photo'])
def photo(message):   
     fileID = message.photo[-1].file_id   
     file_info = bot.get_file(fileID)
     downloaded_file = bot.download_file(file_info.file_path)
     with open("image.jpg", 'wb') as new_file:
         new_file.write(downloaded_file)
Source by ru.stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #save #image #pytelegrambotapi
ADD COMMENT
Topic
Name
5+4 =