Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to new FB webhook structure. #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

CompariBear
Copy link

The Facebook webhook structure changed. I add some prominent changes such as ID types which are strings now.

I also added support for checking the "is_echo" key in the webhook requests.

@@ -58,7 +58,7 @@ type GenericMessage struct {
}

type recipient struct {
ID int64 `json:"id,string"`
ID string `json:"id,string"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you'd better remove 'string' fom tag.

@@ -5,55 +5,78 @@ import "fmt"
// FacebookRequest received from Facebook server on webhook, contains messages, delivery reports and/or postbacks
type FacebookRequest struct {
Entry []struct {
ID int64 `json:"id"`
ID string `json:"id"`
Messaging []struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please create Messaging type out of FacebookRequest? I think it should be convenient for others to use Messaging type as an argument in thiers programms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants