ruboty-slack_rtm 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 5e4546f427a69aee99fc391dd6681301c7109962
4
- data.tar.gz: da84efd1447b98ace8eb8cbe58d433e6d20ce8ce
3
+ metadata.gz: 718c5fe60cd112fc3e5f9f1ace971c856e78f12d
4
+ data.tar.gz: 266e861ed9767c9617ece2370252ef9b8c74796b
5
5
  SHA512:
6
- metadata.gz: 18183e21f0cf9ed4d4b0606555ddd6e50951a8fb732172cd06fb4d1f8d024dd37f537c2c9fbb26bd682b4904f9a6aa6704a55dfd6eb23ea5ff3facad01d45229
7
- data.tar.gz: df72d3706b7aec6e2c32c025ffdad945f189a1e6c6595569aa13bb444cd30dd66f4b89ac82412150d18a0122b91067472f81a57666ba44a6fb4c36975fd88b85
6
+ metadata.gz: c5e3b241f0ae37e7484aa02a7134e429327e51ede86c6874aa78d5475a4fa6497bd8bc66765bd818270158699de6169e2794973d5d5cc967724accab0edc2ff7
7
+ data.tar.gz: 78fe9e8cee1514c7dc053d6acaeadcd59e8c1a1f33dcf3787e5c8d81a23b946af54609c68092dcb9fd8ec05db7c5cf01b421764c5376dcd3fbf017586b0e2477
@@ -74,7 +74,7 @@ module Ruboty
74
74
 
75
75
  def on_message(data)
76
76
  data = resolve_mention!(data)
77
- user = user_info(data['user'])
77
+ user = user_info(data['user']) || {}
78
78
 
79
79
  robot.receive(
80
80
  body: data['text'],
@@ -199,6 +199,8 @@ module Ruboty
199
199
  end
200
200
 
201
201
  def user_info(user_id)
202
+ return {} if user_id.to_s.empty?
203
+
202
204
  @user_info_caches[user_id] ||= begin
203
205
  resp = client.users_info(user: user_id)
204
206
 
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackRTM
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-slack_rtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano