Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

Fix for hardcoded content_type value in quickReplies in BootBot #133

Closed iwko closed 6 years ago

iwko commented 6 years ago

Value for content_type to this moment was hardcoded. You can't use for eg geolocation content_type. Tests are fine but implementation was missing

Charca commented 6 years ago

@iwko the content_type is not really hardcoded, it's the default value. If you look at the method, you'll see it's using Object.assign to extend the default object with whatever you pass to it, so if you pass in a custom content_type value, it should overwrite the default of text. For example:

chat.say({
  text: 'Share your location, please',
  quickReplies: [
    { content_type: 'geolocation' }
  ]
});

That should work correctly. Keep in mind that quickReplies is an array of objects, not an object itself.

iwko commented 6 years ago

@Charca You're right. My bad! Thanks