grape-slack-bot 1.5.5 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/slack_bot/grape_extension.rb +1 -1
- data/lib/slack_bot/interaction.rb +7 -8
- 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: 20631471a50c1063efab2b44ebf94f2ccb3d4d8836eb52e0ec99d709e6e2e221
|
4
|
+
data.tar.gz: 4a956eb022a301cbcf0988a5b8fde6ff21c0fbbc30f94c6f966b4d0ca2febbb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e30000e0c25fd8722fb53d3da386a3e78dd9f8cc490f49e434390c4b256b2450eb5f0542d7f21a30037856d9b197e538cb51f384866b52bd4ea3bcc633e623dc
|
7
|
+
data.tar.gz: 1718485fcfabf43fff9a81fac46fe3b68c285a10e2b7b35b2babfceac5a14a110cacfae9accb81d57f49578c7cab3dd5dfeb5b5ef127bea91fcfcc197e8a2592
|
data/README.md
CHANGED
@@ -452,6 +452,13 @@ module MySlackBot
|
|
452
452
|
class AppHomeOpenedEvent < SlackBot::Event
|
453
453
|
view MySlackBot::AppHomeView
|
454
454
|
def call
|
455
|
+
# NOTE: we have to create callback here in order to handle interactions
|
456
|
+
self.callback = SlackBot::Callback.find_or_create(
|
457
|
+
id: "app_home_opened",
|
458
|
+
user: current_user,
|
459
|
+
class_name: VacationsBot::AppHomeInteraction.name
|
460
|
+
)
|
461
|
+
|
455
462
|
publish_view :index_view
|
456
463
|
end
|
457
464
|
end
|
@@ -84,7 +84,7 @@ module SlackBot
|
|
84
84
|
def handle_block_actions_view(view:, user:, params:)
|
85
85
|
callback_id = view&.dig("callback_id")
|
86
86
|
|
87
|
-
callback = SlackBot::Callback.find(callback_id, config: config)
|
87
|
+
callback = SlackBot::Callback.find(callback_id, user: user, config: config)
|
88
88
|
raise SlackBot::Errors::CallbackNotFound.new if callback.blank?
|
89
89
|
|
90
90
|
SlackBot::DevConsole.log_check "SlackApi::Interactions##{__method__}: #{callback.id} #{callback.payload} #{callback.user_id} #{user&.id}"
|
@@ -47,14 +47,13 @@ module SlackBot
|
|
47
47
|
channel_id: nil,
|
48
48
|
config: nil
|
49
49
|
)
|
50
|
-
callback = Callback.
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
)
|
50
|
+
callback = Callback.find_or_create(
|
51
|
+
id: callback_id,
|
52
|
+
class_name: class_name,
|
53
|
+
user: user,
|
54
|
+
channel_id: channel_id,
|
55
|
+
config: config
|
56
|
+
)
|
58
57
|
|
59
58
|
view = payload.merge({ type: "modal", callback_id: callback.id })
|
60
59
|
response =
|
data/lib/slack_bot.rb
CHANGED