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

Add Facebook account linking support #578

Merged
merged 3 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,16 @@ function Facebookbot(configuration) {
};

facebook_botkit.trigger('facebook_referral', [bot, message]);
} else {
} else if (facebook_message.account_linking) {
var message = {
user: facebook_message.sender.id,
channel: facebook_message.sender.id,
timestamp: facebook_message.timestamp,
account_linking: facebook_message.account_linking,
};

facebook_botkit.trigger('facebook_account_linking', [bot, message]);
} else {
facebook_botkit.log('Got an unexpected message from Facebook: ', facebook_message);
}
}
Expand Down
1 change: 1 addition & 0 deletions readme-facebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Normal messages will be sent to your bot using the `message_received` event. In
| facebook_postback | user clicked a button in an attachment and triggered a webhook postback
| message_delivered | a confirmation from Facebook that a message has been received
| message_read | a confirmation from Facebook that a message has been read
| facebook_account_linking | a user has started the account linking
| facebook_optin | a user has clicked the [Send-to-Messenger plugin](https://developers.facebook.com/docs/messenger-platform/implementation#send_to_messenger_plugin)
| facebook_referral | a user has clicked on a [m.me URL with a referral param](https://developers.facebook.com/docs/messenger-platform/referral-params)

Expand Down