Example #1
0
File: slack.go Project: thuvh/hal
// Reply sends a direct response
func (a *adapter) Reply(res *hal.Response, strings ...string) error {
	newStrings := make([]string, len(strings))
	for _, str := range strings {
		newStrings = append(newStrings, fmt.Sprintf("%s: %s", res.UserName(), str))
	}

	a.Send(res, newStrings...)

	return nil
}
Example #2
0
// Reply sends a direct response
func (a *adapter) Reply(res *hal.Response, strings ...string) error {
	for _, str := range strings {
		s := res.UserName() + `: ` + str
		err := a.writeString(s)
		if err != nil {
			log.Println("error: ", err)
			return err
		}
	}

	return nil
}