Whenever you add quickreplies to a message, you get the following error:
Unhandled rejection TypeError: Cannot read property 'hasOwnProperty' of null
at Bot._callee7$ (~/node_modules/facebook-messenger-bot/dist/Bot.js:479:62)
at tryCatch (~/node_modules/regenerator-runtime/runtime.js:63:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (~/node_modules/regenerator-runtime/runtime.js:337:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (~/node_modules/regenerator-runtime/runtime.js:96:21)
at GeneratorFunctionPrototype.tryCatcher (~/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled (~/node_modules/bluebird/js/release/generators.js:97:49)
at Bot.<anonymous> (~/node_modules/bluebird/js/release/generators.js:201:15)
at Bot.handleMessage (~/node_modules/facebook-messenger-bot/dist/Bot.js:541:23)
at ~/node_modules/facebook-messenger-bot/src/Bot.js:257:11
at Layer.handle [as handle_request] (~/node_modules/express/lib/router/layer.js:95:5)
at next (~/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (~/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (~/node_modules/express/lib/router/layer.js:95:5)
at ~/node_modules/express/lib/router/index.js:277:22
at Function.process_params (~/node_modules/express/lib/router/index.js:330:12)
at next (~/node_modules/express/lib/router/index.js:271:10)
Seems to be caused by the assignment on line 191 of the non-transpiled Bot.js. The problem is that parsing an empty string does not fail, but won't return an object. The fix is to add a default:
Whenever you add quickreplies to a message, you get the following error:
Seems to be caused by the assignment on line 191 of the non-transpiled Bot.js. The problem is that parsing an empty string does not fail, but won't return an object. The fix is to add a default:
That way, you know you're dealing with an object.