Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Put a default content type in fb quick replies
Browse files Browse the repository at this point in the history
  • Loading branch information
ouadie-lahdioui committed Mar 22, 2018
1 parent d7a2e2a commit 0428e51
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var Botkit = require(__dirname + '/CoreBot.js');
var request = require('request');
var crypto = require('crypto');
var bodyParser = require('body-parser');
var clone = require('clone');

function Facebookbot(configuration) {

Expand Down Expand Up @@ -55,7 +56,13 @@ function Facebookbot(configuration) {
platform_message.message.sticker_id = message.sticker_id;
}

if (message.quick_replies) platform_message.message.quick_replies = message.quick_replies;
if (message.quick_replies) {
platform_message.message.quick_replies = message.quick_replies.map(function(item) {
var quick_reply = clone(item);
if (!item.content_type) quick_reply.content_type = 'text';
return quick_reply;
});
}

} else {
platform_message.sender_action = message.sender_action;
Expand Down

0 comments on commit 0428e51

Please sign in to comment.