A whole RPG system within the Hack Club Slack!
To run locally, make sure you have the following installed:
- Yarn
- PostgreSQL: Either install it locally or set up a database in the cloud and get the database URL. More information at https://www.prisma.io/docs/concepts/database-connectors/postgresql. Your database URL should look something like
postgres:://<user>@<location>/<db>
, this is whatDATABASE_URL
is. Nest has a built-in cli to get postgres DBs, try that. - Set up a Slack app. More information at api.slack.com. You should have
SLACK_SIGNING_SECRET
,SLACK_APP_TOKEN
(starts withxapp
), andSLACK_BOT_TOKEN
(starts withxoxb
). Use ngrok to expose port 3001. (tip: use your ngrok-free domain to avoid having to change urls every time you restart). Puthttps://ngrok-url.ngrok-free.app/slack/events
in the interactivity and shortcuts page, the event subscriptions page (subscribe to app_mention), then create all the slash commands (with your prefix) and put the url there too. Make sure you hit the save changes button on each page. - A running Redis instance.
Once you have these, you'll need to git clone
this repo, and then:
yarn install && yarn run db:migrate-deploy
- Fill out
.env.sample
and rename it to.env
. - Add yourself to the the list of maintainers in
maintainers.yaml
. - Run
yarn dev
! - Add the bot to the #bag-approvals channel.
- Start playing with the Slack bot! The first thing you should do is run
/bot
and create an ADMIN app, then approve its request. - Clone the rivques/bag-manifest repo (hopefully merged into mainline soon). Make a .env in the workflow directory and set APP_ID and APP_KEY from the bot you just made, and set BASE_URL to port 3000 of wherever your bag instance is running (probably
http://localhost:3000
). cd
into the workflow directory and runnpm i
, thennode update.js
. This will pull all the items into your DB.- You should now have a local copy of Bag, ready to play with!