Slack app providing slash commands for reserving squash courts.
$ make requirements
Package and deploy the service:
$ make deploy
Set environment variables the app needs to function:
MIT_RECREATION_PASSWORDS=your-password,another-password MIT_RECREATION_USERNAMES=your-username,another-username SLACK_API_TOKEN=your-slack-api-token SLACK_TEAM_ID=your-slack-team-id SLACK_VALID_CHANNELS=some-channel-id,another-channel-id SLACK_VERIFICATION_TOKEN=your-slack-verification-token
Finally, configure slash commands (e.g.,
/book) that POST to the
For information about additional Make targets:
$ make help
courtbot is a Flask app. It can be run locally without using Lambda:
$ make serve
Remember to export the necessary environment variables. If you want to use Slack to test
courtbot changes running locally, use ngrok to expose the server running on your local machine to the Internet:
$ make tunnel
Use the public URL of your tunnel to configure development slash commands (e.g.,
/dev-book) that POST to the
To run the linter (Flake8):
$ make lint
Slack requires that "in channel" slash commands receive a response within 3 seconds.
courtbot uses Zappa's auto keep-warm and asynchronous task execution features to meet this requirement in spite of Lambda's multi-second cold start time and the fact that booking can take upwards of 5 seconds.