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 #645 from ouadie-lahdioui/faceBookAccountLinking
Browse files Browse the repository at this point in the history
Add Facebook thread setting account linking URL
  • Loading branch information
Ben Brown authored Feb 22, 2017
2 parents 56dc509 + 71e3bd2 commit b10ce2f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ examples/db_team_bot/
.DS_Store
*/.DS_Store
.env
.idea
14 changes: 14 additions & 0 deletions lib/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,20 @@ function Facebookbot(configuration) {
};
facebook_botkit.api.thread_settings.deleteAPI(message);
},
account_linking: function(payload) {
var message = {
'setting_type': 'account_linking',
'account_linking_url': payload
};
facebook_botkit.api.thread_settings.postAPI(message);
},
delete_account_linking: function() {
var message = {
'setting_type': 'call_to_actions',
'thread_state': 'existing_thread'
};
facebook_botkit.api.thread_settings.deleteAPI(message);
},
postAPI: function(message) {
request.post('https://graph.facebook.com/v2.6/me/thread_settings?access_token=' + configuration.access_token,
{form: message},
Expand Down
3 changes: 3 additions & 0 deletions readme-facebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ controller.api.thread_settings.menu([
"url":"https://github.com/howdyai/botkit/blob/master/readme-facebook.md"
},
]);
controller.api.thread_settings.account_linking('https://www.yourAwesomSite.com/oauth?response_type=code&client_id=1234567890&scope=basic');
controller.api.thread_settings.delete_account_linking();


controller.hears(['hello'],'facebook_postback', function(bot, message) {
//...
Expand Down

0 comments on commit b10ce2f

Please sign in to comment.