I have a problem sending photo from file with python telegram bot. It is working great with a picture URL but not when trying to send a file from disk.
Steps to reproduce
bot.send_photo(chat_id=update.message.chat_id, photo=open('/mydir/log.jpg', 'rb'))
getting error:
*** BadRequest: Url host is empty
Configuration
OS: Osx
Python: 2.7 python
-m telegram
- _python-telegram-bot 8.0
- certifi 2017.07.27.1
- future 0.16.0
- Python 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]_
According to the doc we can pass file from disk : https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets#post-an-image-file-from-disk