remixz / messenger-bot

A Node client for the Facebook Messenger Platform
MIT License
1.09k stars 213 forks source link

Bot throwing undefined 'forEach' on functions without parsed.entry[0].messaging[0] #77

Closed ianhayes closed 7 years ago

ianhayes commented 7 years ago

TypeError: Cannot read property 'forEach' of undefined getting thrown when using

let getStartedPayloads = [
  {
    payload: 'click_on_welcome_button'
  }
]

bot.setGetStartedButton(getStartedPayloads, (err) => {
  if (err) console.log( err );
})

The issue is from line 183 on index.js. The _handleMessage method was looking for messages but this only exists in user sent messages.

danielnjoo commented 7 years ago

Also interested in this.