setup a webhook for facebook messenger and subscribe to its updates
Install using go get
:
$go get github.com/m90/go-messengerwebhook
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
}
}
Run the tests:
$ make
MIT © Frederik Ring