Awesome Open Source
Awesome Open Source

hanu - Go for Slack Bots!

Current Release MIT License Read Tutorial Code Example

The Go framework hanu is your best friend to create Slack bots! hanu uses allot for easy command and request parsing (e.g. whisper <word>) and runs fine as a Heroku worker. All you need is a Slack API token and you can create your first bot within seconds! Just have a look at the hanu-example bot or read my tutorial


  • Respond to mentions
  • Respond to direct messages
  • Auto-Generated command list for help
  • Works fine as a worker on Heroku


Use the following example code or the hanu-example bot to get started.

package main

import (


func main() {
	slack, err := hanu.New("SLACK_BOT_API_TOKEN")

	if err != nil {

	Version := "0.0.1"

	slack.Command("shout <word>", func(conv hanu.ConversationInterface) {
		str, _ := conv.String("word")

	slack.Command("whisper <word>", func(conv hanu.ConversationInterface) {
		str, _ := conv.String("word")

	slack.Command("version", func(conv hanu.ConversationInterface) {
		conv.Reply("Thanks for asking! I'm running `%s`", Version)


The example code above connects to Slack using SLACK_BOT_API_TOKEN as the bot's token and can respond to direct messages and mentions for the commands shout <word> , whisper <word> and version.

You don't have to care about help requests, hanu has it built in and will respond with a list of all defined commands on direct messages like this:

/msg @hanu help

Of course this works fine with mentioning you bot's username as well:

@hanu help


Use direct messages for communication:

/msg @hanu version

Or use the bot in a public channel:

@hanu version



Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
go (14,705
golang (3,763
framework (1,096
chat (381
slack (310
communication (86
chatops (30
slackbot (28

Find Open Source By Browsing 7,000 Topics Across 59 Categories