Created
May 9, 2018 14:58
-
-
Save ujjkumsi/8d2eb144225ddf1ec1be357adba5efbc to your computer and use it in GitHub Desktop.
Interaction with dialog flow on receiving slack event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ........ | |
| // 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