slack-bulkinviter
slack-bulkinviter copied to clipboard
Reading key from filesystem does not work for me, manual init works just fine
Traceback (most recent call last):
File "inviter.py", line 30, in <module>
response = slack.channels.list()
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 212, in list
params={'exclude_archived': exclude_archived})
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 68, in get
return self._request(requests.get, api, **kwargs)
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 63, in _request
raise Error(response.error)
slacker.Error: invalid_auth
But when I do like here:
from slacker import Slacker
slack = Slacker('<your-slack-api-token-goes-here>')
# Send a message to #general channel
slack.chat.post_message('#general', 'Hello fellow slackers!')
# Get users list
response = slack.users.list()
users = response.body['members']
# Upload a file
slack.files.upload('hello.txt')
It works just fine... I have no experience in Python whatsoever, I've just managed to hack use their initialisation method...
@stefek99 I just pushed some minor changes including the option to pass the API Key as a text string via a command line argument.
Didn't use in a year, cannot tell really now... :)