package
1.0.0
Repository: https://github.com/apex/go-apex.git
Documentation: pkg.go.dev

# README

Apex Api.ai

Providing Api.ai Webhook Events for Apex

Features

This is intended for use with API Gateway or services that use JSON.

Example

package main

import (
	apex "github.com/apex/go-apex"
	"github.com/apex/go-apex/apiai"
)

func main() {
	apiai.HandleFunc(func(event *apiai.Event, ctx *apex.Context) (interface{}, error) {

		// Construct response message
		var message apiai.ResponseMessage
		message.Speech = "Hello!"
		message.DisplayText = "Hey, nice to meet you!"

		return message, nil
	})
}

GitHub @edoardo849  ·  Twitter @edoardo849  ·  Medium

# Functions

Handle Api.ai Events with handler.
HandleFunc handles Api.ai Events with callback function.

# Structs

Context is...
Event data JSON https://docs.api.ai/docs/webhook https://docs.api.ai/docs/query#response.
Fullfillment is.
ResponseMessage is JSON.

# Interfaces

Handler handles api.ai Events.

# Type aliases

HandlerFunc unmarshals Slack Events before passing control.