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

Commit

Permalink
Merge pull request #578 from eubruno/master
Browse files Browse the repository at this point in the history
Add Facebook account linking support
  • Loading branch information
Ben Brown authored Mar 9, 2017
2 parents 8f1426b + 58a1b26 commit 0ff7df0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,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

0 comments on commit 0ff7df0

Please sign in to comment.