Goblin is a Slack bot that integrates with Hack Club Bank
@goblin help: Display help text.
@goblin hello: Make some witty comment about money in the cloud.
@goblin stats: Reports HCB stats.
@goblin apply: Apply to Hack Club Bank! Shows the application link.
@goblin faq: Shows a link to the FAQ page.
@goblin bug: Report a bug! Redirects user to the #bank-counter channel.
Currently, there's a bug in goblin's dependency nlopes/slack caused by Slack releasing an API update
that contains a new
rich_text field after their rich text editor rollout. Until the mainline of the
slack Go library fixes this, build goblin with
go get -u github.com/nlopes/slack@d06c2a2b3249b44a9c5dee8485f5a87497beb9ea
...to build with a version of nlopes/slack that works with the new rich text API.
go build cmd/goblin.go.
./goblin. Goblin should automatically connect to Slack and start handling messages!
We deploy goblin as a systemd service on Linux:
- Create a new user
goblinon Linux with
sudo adduser goblin
- Build the executable and place it at
- Copy over the systemd service file
/etc/systemd/system/goblin.serviceand replace the
your api tokenwith your Slack API Bot OAuth token
- Start the service with
sudo systemctl start goblin
Add a command
To add a new command to Goblin:
- Add a new file that'll define that command. Let's say you're adding a
goodbyecommand to say goodbye to Slack users. First, add
- In that file, define a command that conforms to the
gobline.Commandinterface defined in
pkg/goblin/command.go. You can base your command on
help_command.go, which is a pretty bare-bones command that knows how to respond to a particular message and generate a response.
- Add your command to the client in
pkg/goblin/client.go. Add a new line where it says
// Add new commands hereto create a new instance of your command.
- Add a line or two about the command you just added in both
README.mdto help users discover your new command.