grape-slack-bot 1.5.5 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8369c909fff6a3b4da241ee643cc4eb88aea44b4cf36b46d23894d98485b99b7
4
- data.tar.gz: 6b20d7329e693eada51866d5a20fa57f964bbf24996ff59b073773751dd59843
3
+ metadata.gz: 20631471a50c1063efab2b44ebf94f2ccb3d4d8836eb52e0ec99d709e6e2e221
4
+ data.tar.gz: 4a956eb022a301cbcf0988a5b8fde6ff21c0fbbc30f94c6f966b4d0ca2febbb6
5
5
  SHA512:
6
- metadata.gz: e6e153e24e4b69c9447ab1a91f989213b0786f05ce25fb9ef726b855fe93e847c03ae00496379aa67f24de67f2a4b96e9a49f4c29589898044f04cda73131d41
7
- data.tar.gz: 00aa26edbe0a901e646905ce3ba7b154ca112fd33340a86592860ec9e766ac1ee37bc616d0eaf63bbc9785ca901f761f46f8e60e2da4c0ea8fee31a6a11aedda
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.find(callback_id, config: config) if callback_id.present?
51
- callback ||=
52
- Callback.create(
53
- class_name: class_name,
54
- user: user,
55
- channel_id: channel_id,
56
- config: config
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
@@ -22,5 +22,5 @@ require 'slack_bot/pager'
22
22
  require 'slack_bot/grape_extension'
23
23
 
24
24
  module SlackBot
25
- VERSION = '1.5.5'.freeze
25
+ VERSION = '1.5.6'.freeze
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-slack-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.5
4
+ version: 1.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov