Description
The Go framework hanu is your best friend to create Slack bots! hanu uses platzhalter for easy command parsing (e.g. whisper ) 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 …
hanu alternatives and similar packages
Based on the "Third-party APIs" category.
Alternatively, view hanu alternatives based on common mentions on social networks and blogs.
-
go-openai
OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go -
goamz
Popular fork of goamz which adds some missing API calls to certain packages. -
webhooks
:fishing_pole_and_fish: Webhook receiver for GitHub, Bitbucket, GitLab, Gogs -
githubql
Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). -
twitter-scraper
Scrape the Twitter Frontend API without authentication with Golang. -
openaigo
OpenAI GPT3/3.5 and GPT4 ChatGPT API Client Library for Go, simple, less dependencies, and well-tested -
gostorm
GoStorm is a Go library that implements the communications protocol required to write Storm spouts and Bolts in Go that communicate with the Storm shells. -
hipchat (xmpp)
A golang package to communicate with HipChat over XMPP -
clarifai
DEPRECATED: please use https://github.com/Clarifai/clarifai-go-grpc -
go-trending
Go library for accessing trending repositories and developers at Github. -
go-lark
An easy-to-use SDK for Feishu and Lark Open Platform (Messaging API only) -
simples3
Simple no frills AWS S3 Golang Library using REST with V4 Signing (without AWS Go SDK) -
go-tgbot
Golang telegram bot API wrapper, session-based router and middleware -
go-postman-collection
Go module to work with Postman Collections
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of hanu or a related project?
Popular Comparisons
README
hanu - Go for Slack Bots!
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 …
Features
- Respond to mentions
- Respond to direct messages
- Auto-Generated command list for
help
- Works fine as a worker on Heroku
Usage
Use the following example code or the hanu-example bot to get started.
package main
import (
"log"
"strings"
"github.com/sbstjn/hanu"
)
func main() {
slack, err := hanu.New("SLACK_BOT_API_TOKEN")
if err != nil {
log.Fatal(err)
}
Version := "0.0.1"
slack.Command("shout <word>", func(conv hanu.ConversationInterface) {
str, _ := conv.String("word")
conv.Reply(strings.ToUpper(str))
})
slack.Command("whisper <word>", func(conv hanu.ConversationInterface) {
str, _ := conv.String("word")
conv.Reply(strings.ToLower(str))
})
slack.Command("version", func(conv hanu.ConversationInterface) {
conv.Reply("Thanks for asking! I'm running `%s`", Version)
})
slack.Listen()
}
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
Slack
Use direct messages for communication:
/msg @hanu version
Or use the bot in a public channel:
@hanu version
Dependencies
- github.com/sbstjn/allot for parsing
cmd <param1:string> <param2:integer>
strings - golang.org/x/net/websocket for websocket communication with Slack
Credits
*Note that all licence references and agreements mentioned in the hanu README section above
are relevant to that project's source code only.