slack
is a command line tool for reading messages in Slack.
go get -u github.com/moutend/slack/cmd/slack
Before starting, you need prepare API tokens for this tool.
- Visit api.slack.com/apps.
- Create new app.
- Add the following OAuth scopes:
- Bot scope
users:read
- User scope
channels:history
channels:read
groups:history
groups:read
im:history
im:read
mpim:history
mpim:read
- After setting the scopes, install the app.
- Your bot and user API tokens are issued.
- Set the environement variables like this:
export SLACK_BOT_API_TOKEN="xxxxxxxx"
export SLACK_USER_API_TOKEN="zzzzzzzz"
That's it!
slack whoami
slack users
slack channels
slack messages general
slack messages @someone
MIT
Yoshiyuki Koyanagi <moutend@gmail.com>