Skip to content

Instantly share code, notes, and snippets.

@pocke
Created February 8, 2019 04:46
Show Gist options
  • Select an option

  • Save pocke/b8b2349834cbf4a80753f4d47c662ad6 to your computer and use it in GitHub Desktop.

Select an option

Save pocke/b8b2349834cbf4a80753f4d47c662ad6 to your computer and use it in GitHub Desktop.
require 'slack'
Slack.configure do |conf|
conf.token = ENV.fetch('SLACK_TOKEN')
end
client = Slack::Web::Client.new
channel_names = client.channels_list(exclude_archived: true).channels.reject(&:is_member).map(&:name)
channel_names.each do |name|
puts "Join to #{name}"
client.channels_join(name: name)
end
@pocke

pocke commented Feb 8, 2019

Copy link
Copy Markdown
Author

Join all public channels.
It does not support shared channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment