Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
javawizard committed Mar 20, 2021
1 parent e917cc8 commit dff6e8f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
39 changes: 15 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
concurrent-ruby (1.0.5)
faraday (0.13.1)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
gli (2.17.1)
hashie (3.5.6)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
minitest (5.10.3)
multipart-post (2.0.0)
slack-ruby-client (0.11.0)
activesupport
faraday (>= 0.9)
ruby2_keywords
faraday-net_http (1.0.1)
faraday_middleware (1.0.0)
faraday (~> 1.0)
gli (2.20.0)
hashie (4.1.0)
multipart-post (2.1.1)
ruby2_keywords (0.0.4)
slack-ruby-client (0.17.0)
faraday (>= 1.0)
faraday_middleware
gli
hashie
websocket-driver
thread_safe (0.3.6)
tzinfo (1.2.4)
thread_safe (~> 0.1)
websocket-driver (0.7.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
websocket-extensions (0.1.5)

PLATFORMS
ruby
Expand All @@ -38,4 +29,4 @@ DEPENDENCIES
slack-ruby-client

BUNDLED WITH
1.15.4
2.2.11
11 changes: 9 additions & 2 deletions bin/inviterator
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ end
raise 'need to specify a channel to invite everyone to' if ARGV.length < 1

client = Slack::Web::Client.new
channel = client.channels_list.channels.find do |c|

all_channels = []
client.conversations_list do |response|
all_channels << response.channels
end
all_channels.flatten!

channel = all_channels.find do |c|
c.name == ARGV[0]
end

Expand All @@ -32,7 +39,7 @@ users_to_invite.each_slice(30) do |users|
puts "inviting #{users.map(&:name).join(', ')}"
begin
sleep 2
client.post('channels.invite', channel: channel.id, users: users.map(&:id).join(','))
client.post('conversations.invite', channel: channel.id, users: users.map(&:id).join(','))
rescue Slack::Web::Api::Errors::SlackError => e
# Ignore errors caused by users we tried to invite already being members.
# Note that Slack will still invite all the others to the channel
Expand Down

0 comments on commit dff6e8f

Please sign in to comment.