/go.actions

Encodes and decodes dialogflow fulfillments through Google Actions API requests.

Primary LanguageGo

godoc

About

go.actions encodes and decodes dialogflow fulfillment requests and responses sent through Google Actions.

Install

go get github.com:damondouglas/go.actions

Usage

import (
    "github.com/damondouglas/go.actions/v2/dialogflow"
    "encoding/json"
)

func HandleAction(w http.ResponseWriter, r *http.Request) {
    var req *dialogflow.Request
	if err := json.NewDecoder(r).Decode(&req); err != nil {
        // Handle err
    }

    // Do something with req
}