Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files.upload support as file_upload() into pyslack #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

joshuakwan
Copy link

Just added some code to support the files.upload method. Not able to write a successful mock test so I attach some test code and result here:

from pyslack import SlackClient

slack = SlackClient('xxxxxxx')
res = slack.file_upload(['#test-everything'],'event_handler.py', filetype='py')
print res
{u'ok': True, u'file': {u'filetype': u'python', u'lines_more': 0, u'channels': [u'C077NK40J'], u'display_as_bot': False, u'id': u'F08V40GFR', u'size': 369, u'url_download': u'https://slack-files.com/files-pub/T04D85BG2-F08V40GFR-0ce8bd5b7a/download/event_handler.py', u'title': u'event handler', u'url_private': u'https://files.slack.com/files-pri/T04D85BG2-F08V40GFR/event_handler.py', ...}}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant