Trivial Slack bot
See slack.go
for Slack API; cmd/bot/main.go
is the bot itself. It's tiny and doesn't do anything.
To deploy:
-
Create a new Slack app for your workspace; give it
channels:{history,read}
,chat:write
andusers.read
. Install it; leave the browser window open for a sec. -
flyctl apps create
-
Fix
fly.toml
to set internal_port to 3000 -
flyctl secrets set SLACK_XOXB=[your xoxb here]
-
make deploy
(the Makefile and Dockerfile are both trivial) -
flyctl info
-
Back in the Slack app window, go to the "Event Subscriptions" tab, add the URL for the Fly app (it's the Fly hostname + "/events-endpoint"); it should verify. Subscribe to
messages.channels
. -
In actual Slack, invite your bot to a channel; it should now see messages and annoy you with responses.