/go-messengerwebhook

Receive updates from a messenger webhook like what?!?!

Primary LanguageGo

go-messengerwebhook

Build Status godoc

setup a webhook for facebook messenger and subscribe to its updates

Installation

Install using go get:

$go get github.com/m90/go-messengerwebhook

Usage

Calling New(verifyToken string) returns a http.Handler and a <-chan msngrhook.Update:

handler, updates := msngrhook.New("my_verify_token")
go http.ListenAndServe("0.0.0.0:3000", handler)

for update := range updates {
	if update.Error != nil {
		// handle error
	} else {
		// handle update
	}
}

Tests

Run the tests:

$ make

License

MIT © Frederik Ring