slack-bulkinviter icon indicating copy to clipboard operation
slack-bulkinviter copied to clipboard

Reading key from filesystem does not work for me, manual init works just fine

Open stefek99 opened this issue 7 years ago • 2 comments

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 avatar Apr 05 '17 15:04 stefek99

@stefek99 I just pushed some minor changes including the option to pass the API Key as a text string via a command line argument.

tdemarest avatar May 26 '18 03:05 tdemarest

Didn't use in a year, cannot tell really now... :)

stefek99 avatar May 27 '18 18:05 stefek99