os / slacker

Full-featured Python interface for the Slack API
Apache License 2.0
1.6k stars 245 forks source link

Unable to upload files by content. #41

Closed dragonpaw closed 7 years ago

dragonpaw commented 9 years ago

Right now, files.upload requires a file on disk, but it would be great if slacker.files.upload would take (and use) a string instead of a filename.

I'm trying to upload files that I grabbed off the web, and being able to have the following work would be great:

import requests
slack.files.upload(content=requests.get(url).content)
# or
slack.files.upload(url=url)
os commented 8 years ago

Slacker just mimics the Slack API. We could do the first one, maybe as a separate method. I'm not keen on the second one since I don't think fetching content from web should be a part of the library.