-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: master
Are you sure you want to change the base?
Conversation
@@ -58,7 +58,7 @@ type GenericMessage struct { | |||
} | |||
|
|||
type recipient struct { | |||
ID int64 `json:"id,string"` | |||
ID string `json:"id,string"` |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
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.