grape-slack-bot 1.2.2 → 1.2.3

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: 99c07a4830556a1a896dea28c85f7fade663c8b49b6e649d084e2bf115a8eacd
4
- data.tar.gz: 6dcce44e9edaf18c97f62dbf65fa248d6b309caad9e9ed6dcf7cdf327a16f063
3
+ metadata.gz: 3472ece85beebd447e192f73013849e3e37a366fdc22b4f4864ef0908f58f502
4
+ data.tar.gz: 7f25928036698338c354238d9615ccd980d136a0c88056be1a1989304c95eae9
5
5
  SHA512:
6
- metadata.gz: 64c24157366d85a69449488dde1aa029f562afde69e0b3c210241d2e4778675842ed9003012f9f19193e0ef04d5a45f48f0acd70bfae9a55cc831667d4c0ee25
7
- data.tar.gz: a399297e42b45b7be8bd05587abeb9150fba0276953c1771a46c05bbaee7b29361181cb16fc5b672d58bd68fcfe869b706166dd664261b61ac86e45bd633b3a7
6
+ metadata.gz: a2902bfc733cd9aec81df154e0c43ac2bfe9eca7fd6105cb7b6d2f1ea1631daae093e2a96698388accaf35b46c4da826218333bab3c78bed7781c17583e01312
7
+ data.tar.gz: 04a70f1a3a5251d44d2b4bb21cdaa113296d50c51b0fae010f27f5c1a7caeb5b41eb635c6d349672701a5aef13c58f39249f8e740a2310ab5024dd822e7341ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.2.3
2
+
3
+ * Minor fix for Events API
4
+
1
5
  # 1.2.2
2
6
 
3
7
  * `SlackBot::Callback.find` method will raise `SlackBot::Errors::CallbackNotFound` if callback is not resolved or has wrong data
@@ -22,11 +22,11 @@ module SlackBot
22
22
  params["event"]["type"]
23
23
  end
24
24
 
25
- def publish_view(view_method_name)
25
+ def publish_view(view_method_name, context: nil)
26
26
  user_id = params["event"]["user"]
27
27
  view =
28
28
  self.class.view_klass
29
- .new(current_user: current_user, params: params)
29
+ .new(current_user: current_user, params: params, context: context)
30
30
  .send(view_method_name)
31
31
  response =
32
32
  SlackBot::ApiClient.new.views_publish(user_id: user_id, view: view)
@@ -84,11 +84,9 @@ module SlackBot
84
84
 
85
85
  def handle_block_actions_view(view:, user:, params:)
86
86
  callback_id = view&.dig("callback_id")
87
- callback = SlackBot::Callback.find(callback_id, config: config)
88
87
 
89
- if callback.blank?
90
- raise "Callback not found"
91
- end
88
+ callback = SlackBot::Callback.find(callback_id, config: config)
89
+ raise SlackBot::Errors::CallbackNotFound.new if callback.blank?
92
90
 
93
91
  SlackBot::DevConsole.log_check "SlackApi::Interactions##{__method__}: #{callback.id} #{callback.extra} #{callback.user_id} #{user&.id}"
94
92
 
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.2.2'.freeze
25
+ VERSION = '1.2.3'.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.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov