Advertisement
Guest User

2435678908765432

a guest
Mar 8th, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1.  try:
  2.         file_info = bot.get_file(message.photo[len(message.photo) - 1].file_id)
  3.         downloaded_file = bot.download_file(file_info.file_path)
  4.  
  5.         src = MEDIA_URL + file_info.file_path
  6.         with open(src, 'wb') as new_file:
  7.             new_file.write(downloaded_file)
  8.  
  9.         bot.register_next_step_handler(send,photo_in)
  10.     except Exception as e:
  11.         bot.reply_to(message, e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement