davidchua / pymessenger

A Python Wrapper for the FB Messenger Bot API (Send/Receive API)
MIT License
457 stars 183 forks source link

AttributeError 'Bot' object has no attribute 'base_url' for bot.send_image #17

Closed pseudonymcp closed 8 years ago

pseudonymcp commented 8 years ago

Hi, I wanted to send an image as a file, not via url, but got an AttributeError 'Bot' object has no attribute 'base_url' for bot.send_image.

Traceback (most recent call last):
  File "paul.py", line 166, in webhook
    bot.send_image(sender_id, generated_image)
  File "/home/psuser/paul/paul/local/lib/python2.7/site-packages/pymessenger/bot.py", line 135, in send_image
    return requests.post(self.base_url, data=multipart_data, headers=multipart_header).json()
AttributeError: 'Bot' object has no attribute 'base_url'
Cretezy commented 8 years ago

Hey, looks like that function was never actually tested. I've been working on a minor rewrite that works with local attachments. Try using the partial-rewrite branch!

Cretezy commented 8 years ago

Fixed in #18