2020-08-25: Goblin is no longer being maintained, supported, or developed by Hack Club HQ.
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.
Build with go build cmd/goblin.go.
Run with ./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 withsudo adduser goblin - Build the executable and place it at
/home/goblin/goblin - Copy over the systemd service file
goblin.serviceto/etc/systemd/system/goblin.serviceand replace theyour api tokenwith your Slack API Bot OAuth token - Start the service with
sudo systemctl start goblin
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, addpkg/goblin/goodbye_command.go. - In that file, define a command that conforms to the
gobline.Commandinterface defined inpkg/goblin/command.go. You can base your command onhelp_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
help_command.goandREADME.mdto help users discover your new command.