func (s *slacker) Notify(eva EventAction, edata EventData) error { if !s.satisfied(eva) { return nil } if err := slack.NewClient(s.token).SendMessage("#"+s.chnl, edata.M["message"], "megamio"); err != nil { return err } return nil }
func main() { slackC = slack.NewClient(config.SlackToken) port := ":4000" if os.Getenv("ENV") == "production" { port = ":80" } server := web.NewServer(port, []web.Handler{ new(web.SlashHandler), new(web.CorsHandler), &web.StatHandler{Key: config.StatHatKey, Name: "broome"}, }, Routes) server.AuthHandler = &web.AuthHandler{Auth: AuthHandler} server.ListenAndServe() }