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

Fix JSON object structure #1

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

Conversation

orsonwang
Copy link

Hi there:
It seems that go cannot unmarshal correctly under current structure matrix. I have add 4 element onto two topmost level struct at server.go. Then it works.
Just send it back and see if you want to merge it.

@frodsan
Copy link
Owner

frodsan commented May 18, 2016

What version of Go are you using?

@@ -34,17 +34,19 @@ func verifyToken(bot *Bot, w http.ResponseWriter, r *http.Request) {
}

type receive struct {
Object string `json:"object"`
Copy link
Owner

Choose a reason for hiding this comment

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

Object is a string and always "page". Not sure if we need this:

https://developers.facebook.com/docs/messenger-platform/webhook-reference#common_format

Copy link
Author

Choose a reason for hiding this comment

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

At least we have to set it to json:"-" I think.
2016年5月18日 20:23於 "frodsan" notifications@github.com寫道:

In server.go #1 (comment)
:

@@ -34,17 +34,19 @@ func verifyToken(bot *Bot, w http.ResponseWriter, r *http.Request) {
}

type receive struct {

  • Object string json:"object"

Object is a string and always "page". Not sure if we need this:

https://developers.facebook.com/docs/messenger-platform/webhook-reference#common_format


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/frodsan/fbot/pull/1/files/eeb7ca1f0fb47cd09ae101dd9707bdee44a33268#r63692587

@orsonwang
Copy link
Author

1.6.2 on Red hat 6.7 and OSX 10.11.4.
2016年5月18日 20:21於 "frodsan" notifications@github.com寫道:

What version of Go are you using?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1 (comment)

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