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

Add support for Facebook location quick replies #568

Merged
merged 3 commits into from
Jan 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,24 @@ function Facebookbot(configuration) {
};

facebook_message.message.quick_replies = message.quick_replies.map(function(item) {
return {
content_type: item.content_type || 'text',
title: titleLimit(item.title),
payload: item.payload,
image_url: item.image_url,
};
var quick_reply = {}
if (item.content_type === 'text' || !item.content_type) {
quick_reply = {
content_type: 'text',
title: titleLimit(item.title),
payload: item.payload,
image_url: item.image_url,
}
}
else if (item.content_type === 'location') {
quick_reply = {
content_type: 'location'
}
}
else {
// Future quick replies types
}
return quick_reply;
});
}
} else {
Expand Down