You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
* Your contribution here.
6
6
7
+
*[#95](https://github.com/slack-ruby/slack-ruby-bot-server/pull/95): Expose the optional `state` parameter that is returned from the Add to Slack button - [@aok-solutions](https://github.com/aok-solutions).
8
+
7
9
#### 0.9.0 (2019/2/25)
8
10
9
11
*[#93](https://github.com/slack-ruby/slack-ruby-bot-server/pull/93): Removed ping worker in favor of slack-ruby-client lower level ping - [@dblock](https://github.com/dblock).
Copy file name to clipboardExpand all lines: README.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,15 +103,15 @@ You can introduce custom behavior into the service lifecycle via callbacks. This
103
103
```ruby
104
104
instance =SlackRubyBotServer::Service.instance
105
105
106
-
instance.on :createddo |team, error|
106
+
instance.on :createddo |team, error, options|
107
107
# a new team has been registered
108
108
end
109
109
110
-
instance.on :deactivateddo |team, error|
110
+
instance.on :deactivateddo |team, error, options|
111
111
# an existing team has been deactivated in Slack
112
112
end
113
113
114
-
instance.on :errordo |team, error|
114
+
instance.on :errordo |team, error, options|
115
115
# an error has occurred
116
116
end
117
117
```
@@ -132,6 +132,22 @@ The following callbacks are supported. All callbacks receive a `team`, except `e
132
132
| deactivating | a team is being deactivated |
133
133
| deactivated | a team has been deactivated |
134
134
135
+
136
+
The [Add to Slack button](https://api.slack.com/docs/slack-button) also allows for an optional `state` parameter that will be returned on completion of the request. The `creating` and `created` callbacks include an options hash where this value can be accessed (to check for forgery attacks for instance).
0 commit comments