Skip to content

Instantly share code, notes, and snippets.

@ujjkumsi
Created May 9, 2018 14:58
Show Gist options
  • Select an option

  • Save ujjkumsi/8d2eb144225ddf1ec1be357adba5efbc to your computer and use it in GitHub Desktop.

Select an option

Save ujjkumsi/8d2eb144225ddf1ec1be357adba5efbc to your computer and use it in GitHub Desktop.
Interaction with dialog flow on receiving slack event
........
// Parse message
m := strings.Split(strings.TrimSpace(ev.Text), " ")[1:]
if len(m) == 0 {
return fmt.Errorf("invalid message %s", m)
}
query := strings.Join(m, " ")
log.Printf("Query : %s", query)
message := GetIntent(query)
log.Printf("Response : %s", message)
rtm.SendMessage(rtm.NewOutgoingMessage(message, ev.Channel))
........
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment