Skip to content

Commit

Permalink
Document passing access token to Thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jgorset committed Nov 23, 2016
1 parent e9f403f commit 11170c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,33 +166,33 @@ end
You can greet new humans to entice them into talking to you:

```ruby
Facebook::Messenger::Thread.set(
Facebook::Messenger::Thread.set({
setting_type: 'greeting',
greeting: {
text: 'Welcome to your new bot overlord!'
}
)
},
}, access_token: ENV['ACCESS_TOKEN'])
```

You can define the action to trigger when new humans click on the Get
Started button. Before doing it you should check to select the messaging_postbacks field when setting up your webhook.

```ruby
Facebook::Messenger::Thread.set(
Facebook::Messenger::Thread.set({
setting_type: 'call_to_actions',
thread_state: 'new_thread',
call_to_actions: [
{
payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_WELCOME'
}
]
)
}, access_token: ENV['ACCESS_TOKEN'])
```

You can show a persistent menu to humans.

```ruby
Facebook::Messenger::Thread.set(
Facebook::Messenger::Thread.set({
setting_type: 'call_to_actions',
thread_state: 'existing_thread',
call_to_actions: [
Expand All @@ -212,7 +212,7 @@ Facebook::Messenger::Thread.set(
url: 'http://example.com/'
}
]
)
}, access_token: ENV['ACCESS_TOKEN'])
```

## Configuration
Expand Down

0 comments on commit 11170c1

Please sign in to comment.