ruboty-slack_take_turns 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/ruboty/handlers/slack_take_turns.rb +0 -0
- data/lib/ruboty/slack_take_turns.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/assign.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/base.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/current.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/exclude.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/force.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/include.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/members.rb +0 -0
- data/lib/ruboty/slack_take_turns/actions/next.rb +0 -0
- data/lib/ruboty/slack_take_turns/locale/en.yml +0 -0
- data/lib/ruboty/slack_take_turns/locale/ja.yml +0 -0
- data/lib/ruboty/slack_take_turns/slack_client.rb +6 -16
- data/lib/ruboty/slack_take_turns/version.rb +1 -1
- data/ruboty-slack_take_turns.gemspec +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86a3c6b945edd4c52bd10ce98d481691f818a81ed0a2a5c033821ff32b7c18e9
|
4
|
+
data.tar.gz: 14951a5881e82732b2584e284fc3c36ef7d154ec51d9db35218d40034a633cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337b5acb5193b672d5bf153138f9cea62a202890ec89b96f4ddd0826c9411b761c0d98c9b6ef304878615cf0ab82532e0f3f59c5a794ab18ef1330027f25b36c
|
7
|
+
data.tar.gz: 4c06ab5b299ac49860d5ffbca201a6dff39e3ae34d64a32ee702da66987ec2d9a8671eb8e27d425fa8c82efab2c620690d6fd099075dcf2c41ab6ca822ced1c0
|
data/.gitignore
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -7,7 +7,7 @@ module Ruboty
|
|
7
7
|
def initialize(channel)
|
8
8
|
@client ||= Slack::Client.new(token: ENV['SLACK_TOKEN'])
|
9
9
|
@channel = channel
|
10
|
-
@
|
10
|
+
@conversations_members = {}
|
11
11
|
end
|
12
12
|
|
13
13
|
def all_users
|
@@ -25,7 +25,7 @@ module Ruboty
|
|
25
25
|
def channel_user_ids
|
26
26
|
unless @channel_user_ids&.dig(channel)
|
27
27
|
@channel_user_ids = {} unless @channel_user_ids
|
28
|
-
ids =
|
28
|
+
ids = conversations_members(channel)
|
29
29
|
# 退職してアカウント停止した人とボットは除く
|
30
30
|
ids = ids.select{|id| user = find_user_by_user_id(id); !user['deleted'] && !user['is_bot']}
|
31
31
|
@channel_user_ids[channel] = ids.sort
|
@@ -33,20 +33,10 @@ module Ruboty
|
|
33
33
|
@channel_user_ids[channel]
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
37
|
-
|
38
|
-
@
|
39
|
-
@
|
40
|
-
end
|
41
|
-
|
42
|
-
def private_channel_user_ids(channel)
|
43
|
-
channel_info = @channels_info[channel]
|
44
|
-
@channels_info[channel] = client.groups_info(channel: channel) unless channel_info
|
45
|
-
@channels_info[channel]['group']['members']
|
46
|
-
end
|
47
|
-
|
48
|
-
def private_channel?(channel)
|
49
|
-
channel[0] == "G"
|
36
|
+
def conversations_members(channel)
|
37
|
+
members = @conversations_members[channel]
|
38
|
+
@conversations_members[channel] = client.conversations_members(channel: channel)['members'] unless members
|
39
|
+
@conversations_members[channel]
|
50
40
|
end
|
51
41
|
|
52
42
|
def find_user_by_user_id(user_id)
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-slack_take_turns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oharato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|