Slack bot for CHIME tsarina shift hand-offs.
Based on https://github.com/slackapi/template-slash-command-and-dialogs
- Create an app at https://api.slack.com/apps
- Add a Slash command (See Add a Slash Command section below)
- Enable Interactive components (See Enable Interactive Components below)
- Navigate to the OAuth & Permissions page and select the following bot token scopes:
commands
chat:write
users:read
users:read.email
im:write
- Click 'Save Changes' and install the app (You should get an OAuth access token after the installation)
- Go back to the app settings and click on Slash Commands.
- Click the 'Create New Command' button and fill in the following:
- Command:
/signoff
- Request URL: Your server URL +
/signoff
- Short description:
Sign off from a tsar shift
- Command:
- Click the 'Create New Command' button and fill in the following:
- Command:
/signin
- Request URL: Your server URL +
/signin
- Short description:
Sign in for a tsar shift
- Command:
- Go back to the app settings and click on Interactive Components.
- Set the Request URL to your server or Glitch URL +
/report
. - Save the change.
- Get the code
- Clone this repo and run
npm install
- Clone this repo and run
- Set the following environment variables to
.env
(see.env.sample
):ANASTASIA_SLACK_ACCESS_TOKEN
: Your bot token,xoxb-
(available on the OAuth & Permissions once you install the app)ANASTASIA_SLACK_SIGNING_SECRET
: Your app's Signing Secret (available on the Basic Information page)ANASTASIA_SLACK_CHANNEL
: The ID of the channel anastasia should post to (you find it in the URL when visiting the channel with a browser)
- Run the app (
npm start
).