slackify 0.3.0 โ 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/app/controllers/slackify/slack_controller.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f1105d73a8943514708110e7b544fbaf8e300770f902103dcca4da95bfc9fa
|
4
|
+
data.tar.gz: b4a2b7dd7fcffed2cce55214fb96d2d09ea6ff40513d0360900187118857b6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a80fbbb042403ae528e9563c7d3cdaec8462e30a6aaf033d1c93c804b9e78cb58e1b03cbd1c324cab8329eb697da35fe5d81e47dffe633643fd39192d507a802
|
7
|
+
data.tar.gz: f822f3cf7448b07f946f3a7d07b644d1ae70a57ee9cc8a9f06996c2de20f36561b4894294f5c350ab5c7a44394e75aed1e2a5ef1f127e1ee47cdac000975edbd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## V0.3.2
|
2
|
+
|
3
|
+
* Add support for interactive block payloads ([b6cf1db](https://github.com/jusleg/slackify/commit/b6cf1dbb47b832037ebff56054efa27c9e3251dc)) by [@drose-shopify](https://github.com/drose-shopify)
|
4
|
+
|
1
5
|
## V0.3.0
|
2
6
|
|
3
7
|
* Add code documentation and improve exception message
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Slackify [![
|
1
|
+
# Slackify [![Tests ๐งช](https://github.com/jusleg/slackify/workflows/Tests%20%F0%9F%A7%AA/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Tests+%F0%9F%A7%AA%22) [![Lint ๐](https://github.com/jusleg/slackify/workflows/Lint%20%F0%9F%92%8E/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Lint+%F0%9F%92%8E%22) [![Gem Version](https://badge.fury.io/rb/slackify.svg)](https://badge.fury.io/rb/slackify) ![Gem downloads](https://img.shields.io/gem/dt/slackify)
|
2
2
|
|
3
3
|
Slackify is a gem that allows to build slackbots on Rails using the [Event API](https://api.slack.com/events-api) from Slack.
|
4
4
|
|
@@ -21,7 +21,14 @@ module Slackify
|
|
21
21
|
|
22
22
|
def interactive_callback
|
23
23
|
parsed_payload = JSON.parse(params[:payload])
|
24
|
-
|
24
|
+
|
25
|
+
callback_id = if parsed_payload.key?('view')
|
26
|
+
parsed_payload.dig('view', 'callback_id')
|
27
|
+
else
|
28
|
+
parsed_payload['callback_id']
|
29
|
+
end
|
30
|
+
|
31
|
+
response = handler_from_callback_id(callback_id).call(parsed_payload)
|
25
32
|
if !response.nil?
|
26
33
|
Timeout.timeout(SLACK_TIMEOUT_SECONDS) do
|
27
34
|
render json: response
|
@@ -30,7 +37,7 @@ module Slackify
|
|
30
37
|
head :ok
|
31
38
|
end
|
32
39
|
rescue Timeout::Error
|
33
|
-
raise Timeout::Error, "Slack interactive callback timed out for #{
|
40
|
+
raise Timeout::Error, "Slack interactive callback timed out for #{callback_id}"
|
34
41
|
end
|
35
42
|
|
36
43
|
def slash_command_callback
|