-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintent.go
More file actions
27 lines (23 loc) · 869 Bytes
/
intent.go
File metadata and controls
27 lines (23 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"github.com/Eraac/dialogflow"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/train-cat/bot/intent"
)
func getHandler() *dialogflow.Router {
h := dialogflow.NewRouter(dialogflow.Config{
Debug: viper.GetBool("bot.debug"),
Token: viper.GetString("dialogflow.token"),
Logger: logrus.StandardLogger(),
})
h.HandleFunc(intent.ActionWelcome, intent.Welcome)
h.HandleFunc(intent.ActionCancel, intent.Cancel)
h.HandleFunc(intent.ActionHelp, intent.Help)
h.HandleFunc(intent.ActionThankYou, intent.ThankYou)
h.HandleFunc(intent.ActionAskingForCreateAlert, intent.AskingForCreateAlert)
h.HandleFunc(intent.ActionCreateAlert, intent.CreateAlert)
h.HandleFunc(intent.ActionCreateAlertSelectStoptime, intent.CreateAlertSelectStoptime)
h.HandleFunc(intent.ActionCreateAlertRetry, intent.CreateAlertRetry)
return h
}