dfab-bot
1. Slack API
pip install slackclient
- Create a Slack App
- Click on the new App - Install App and get Bot User OAuth Access Token.
export SLACK_BOT_TOKEN='your bot user access token'
.
- copy script from gist.
- Check if the script works right.
2. Trello API
- Go to https://trello.com/1/appKey/generate and generate API key.
export KEY='your trello API key'
- Go to https://trello.com/1/authorize?key=[KEY]&name=SimpleBASHScript&expiration=never&response_type=token&scope=read,write and get token
export TOKEN='your trello API token'
.
- Using given key and token, go to https://developers.trello.com/v1.0/reference#introduction and check.
- What i've used:
3. Integration
- Command format:
@DFAB get [user initial] [period] [a/b]
.
trello_api.py
: receive arguments, requests and preprocess user's trello data and return.
starterbot.py
: split the command, pass arguments to get trello data, pass output to the user.
forever.py
: run forever in local!
4. Distribution
local PC (24hr): nohup ./forever starterbot.py > /dev/null 2>&1&
Reference
- https://www.fullstackpython.com/blog/build-first-slack-bot-python.html
- https://gist.github.com/CrookedNumber/8856939
- https://developers.trello.com/v1.0/reference#introduction