jamietsao / slack-multi-channel-invite

Script to invite a user to multiple Slack channels at once
25 stars 10 forks source link

Cannot add users to private channels #1

Closed jhwheeler closed 3 years ago

jhwheeler commented 3 years ago

First of all, thank you! This is going to save me so much time :D

However, the script returns an error, channel_not_found when the channel is private. After reading the explanation in the README on how this is implemented through fetching all public channels, I see why this doesn't work. So I'm wondering if you have a workaround or any ideas on how to extend this to be able to invite users to private channels as well.

If you have any ideas, I would love to contribute; my Go skills are rudimentary, but I'm learning now and this would be some good practice + a useful contribution.

Thanks!

jamietsao commented 3 years ago

Hello! Glad to know this may be useful for people other than me!

It's been awhile since I've written this so I'll need to refresh my memory on things. I'll take a closer look and get back to you. Please feel free to ping again if I don't respond.

jamietsao commented 3 years ago

@jhwheeler - Done!

Turns out it was pretty simple to add private channel support. Your token will require the additional scopes of groups:read and groups:write. Just run the command with -private=true (so you'll have to run it once for public channels and once for private channels).

I've updated the README and published a new release: https://github.com/jamietsao/slack-multi-channel-invite/releases/tag/v0.2.0

Let me know if you run into any issues.