steps to make this work:
-
Install Dependencies
yarn yarn build
-
Make sure you register your app with the slack events api (listen at least for these three events: ["message.channels", "message.groups", "message.im"]) and update the /packages/protobot/.env.sample with your credentials and save it as .env. Instructions can be found here
-
Test locally from the protobot dir with yarn start. Use ngrok to forward your port 3333. Update your slack config with the ngrok url + /webhooks/slack
-
Your protobot needs to be initialized first. This can be done with the grapqhl api. Docs are in the playground. But it's basically one command:
mutation Init($input:BWAEvent!){ sendEvent(event: $input){ currentState } }
and input variables
{ "input":{ "eventType": "INITIALIZED", "payload": { "botName": "HELOO", "cassettes": ["stgjasds"] } } }
-
Hook your own code into the botframe/machine/routes module. I'm using the bottender botframe work under the hood. You only have to add the correct actions. Docs are here and here
-
There is a dockerfile in the root dir. This can be used to deploy your protobot once your done.
docker build -t @offcourse/protobot . docker run docker run -p 80:3333 -d offcourse/protobot