grape-slack-bot 1.6.9 → 1.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slack_bot/interaction.rb +17 -11
- data/lib/slack_bot.rb +1 -1
- 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: 182ee366d5e5d1fb89152bcd753a75e4361b8f611fa1d9ca0a4b81dc5f6221ab
|
4
|
+
data.tar.gz: 49f18848a1abef7bf401eb3af87a2037ba25850d0a9043428a4f44cba6bd2371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8379e1b62eb08f3dcf9507dffa299ac07d4c4753ac544e502ecef8f28107f7166df66c8f2783a338e58cd1a41f8f5702678650ac19aad100c597300097bb330e
|
7
|
+
data.tar.gz: 7ee9589a200c7c105948df9751878ebf231430b3aa6313cfc86533de254e0340e01205e2d339810741fe7c2411c368083a1924511280671de63cb9be2d87f0ca
|
@@ -9,7 +9,7 @@ module SlackBot
|
|
9
9
|
include SlackBot::Concerns::ViewKlass
|
10
10
|
|
11
11
|
def self.open_modal(callback:, trigger_id:, view:)
|
12
|
-
view = view.merge({ type: "modal", callback_id: callback
|
12
|
+
view = view.merge({ type: "modal", callback_id: callback&.id })
|
13
13
|
response =
|
14
14
|
SlackBot::ApiClient.new.views_open(trigger_id: trigger_id, view: view)
|
15
15
|
|
@@ -18,13 +18,15 @@ module SlackBot
|
|
18
18
|
end
|
19
19
|
|
20
20
|
view_id = response.data.dig("view", "id")
|
21
|
-
callback.
|
22
|
-
|
23
|
-
|
21
|
+
if callback.present? && view_id.present?
|
22
|
+
callback.view_id = view_id
|
23
|
+
callback.save
|
24
|
+
end
|
25
|
+
SlackViewsReply.new(callback&.id, view_id)
|
24
26
|
end
|
25
27
|
|
26
28
|
def self.update_modal(callback:, view_id:, view:)
|
27
|
-
view = view.merge({ type: "modal", callback_id: callback
|
29
|
+
view = view.merge({ type: "modal", callback_id: callback&.id })
|
28
30
|
response =
|
29
31
|
SlackBot::ApiClient.new.views_update(view_id: view_id, view: view)
|
30
32
|
|
@@ -33,9 +35,11 @@ module SlackBot
|
|
33
35
|
end
|
34
36
|
|
35
37
|
view_id = response.data.dig("view", "id")
|
36
|
-
callback.
|
37
|
-
|
38
|
-
|
38
|
+
if callback.present? && view_id.present?
|
39
|
+
callback.view_id = view_id
|
40
|
+
callback.save
|
41
|
+
end
|
42
|
+
SlackViewsReply.new(callback&.id, view_id)
|
39
43
|
end
|
40
44
|
|
41
45
|
def self.publish_view(callback: nil, metadata: nil, user_id:, view:)
|
@@ -49,9 +53,11 @@ module SlackBot
|
|
49
53
|
end
|
50
54
|
|
51
55
|
view_id = response.data.dig("view", "id")
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
if callback.present? && view_id.present?
|
57
|
+
callback.view_id = view_id
|
58
|
+
callback.save
|
59
|
+
end
|
60
|
+
SlackViewsReply.new(callback&.id, view_id)
|
55
61
|
end
|
56
62
|
|
57
63
|
attr_reader :current_user, :params, :callback, :config
|
data/lib/slack_bot.rb
CHANGED