Created
February 8, 2019 04:46
-
-
Save pocke/b8b2349834cbf4a80753f4d47c662ad6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Join all public channels.
It does not support shared channels.