Esempio n. 1
0
func (c *Core) handlePassiveCatchAll(b core.Bot, m *slack.Message) error {
	message := util.TrimWhitespace(core.LessMentions(m.Text))
	if optionValue, hasOption := b.Configuration()[ConfigOptionPassiveCatchAll]; hasOption && optionValue == "true" {
		if core.IsAngry(message) {
			user := b.FindUser(m.User)
			response := []string{"slow down %s", "maybe calm down %s", "%s you should really relax", "chill %s", "it's ok %s, let it out"}
			return b.Sayf(m.Channel, core.Random(response), strings.ToLower(user.Profile.FirstName))
		}
	}

	return nil
}
Esempio n. 2
0
func (c *Core) handleSalutation(b core.Bot, m *slack.Message) error {
	user := b.FindUser(m.User)
	salutation := []string{"hey %s", "hi %s", "hello %s", "ohayo gozaimasu %s", "salut %s", "bonjour %s", "yo %s", "sup %s"}
	return b.Sayf(m.Channel, core.Random(salutation), strings.ToLower(user.Profile.FirstName))
}