Leave a Comment
Go library for creating slack bots
You can use it like that:
package main
import (
"context"
"github.com/shomali11/slacker"
"log"
)
func main() {
bot := slacker.NewClient("")
definition := &slacker.CommandDefinition{
Handler: func(request slacker.Request, response slacker.ResponseWriter) {
response.Reply("pong")
},
}
bot.Command("ping", definition)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
err := bot.Listen(ctx)
if err != nil {
log.Fatal(err)
}
}
LEAVE A COMMENT
Для отправки комментария вам необходимо авторизоваться.