func Message(client *hipchat.Client, cfg *config.Config) error { req := &hipchat.RoomMessageRequest{ Message: cfg.FormattedMessage(), } fmt.Printf("%+v\n", req) _, err := client.Room.Message(cfg.Room, req) fmt.Printf("%+v\n", err) return err }
// some simple wrappers for common actions func Notify(client *hipchat.Client, cfg *config.Config) error { req := &hipchat.NotificationRequest{ Message: cfg.FormattedMessage(), Notify: config.ToBool(cfg.Notify), Color: cfg.Color, } fmt.Printf("%+v\n", req) _, err := client.Room.Notification(cfg.Room, req) fmt.Printf("%+v\n", err) return err }