Skip to content

Instantly share code, notes, and snippets.

@jfchevrette
Created September 13, 2019 20:41
Show Gist options
  • Save jfchevrette/dd34b16b87db72f4f591a4c66896dbb0 to your computer and use it in GitHub Desktop.
Save jfchevrette/dd34b16b87db72f4f591a4c66896dbb0 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/go-joe/joe"
"github.com/go-joe/slack-adapter"
)
type SlackBot struct {
*joe.Bot
joe.Module
}
func main() {
b := &SlackBot{
Bot: joe.New("testbot", slack.Adapter("TOKEN")),
}
b.Respond("test", b.Test)
err := b.Run()
if err != nil {
b.Logger.Fatal(err.Error())
}
}
func (b *SlackBot) Test(msg joe.Message) error {
msg.Respond("test")
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment