fbsamples / messenger-bot-samples

Messenger Bot Samples
Other
555 stars 441 forks source link

Comments uncompatible with documentation #32

Closed malpunek closed 6 years ago

malpunek commented 6 years ago

Official docs clearly say: msg_issue

However messenger-bot-samples/account-linking/routes/webhooks.js:65-66 have the following two lines:

// Iterate over each messaging event
pageEntry.messaging.forEach((messagingEvent) => {

I find the lines very misleading.

embee8 commented 6 years ago

The screenshot above says that the webhook event contains a messaging field (first column) that is an array (second column) with one element (third column). Therefore, the code treats this field as an array and iterates over it. Because there is only one messagingEvent, it will only be passed through once.

I hope this clarifies it for you. If not, please elaborate on how you find this misleading.