robby-d / slack-bulkinviter Goto Github PK
View Code? Open in Web Editor NEWBulk invite users to a slack channel
License: MIT License
Bulk invite users to a slack channel
License: MIT License
Can we have this script modified to ignore single channel guests?
When i specify private channel ID, it throws Cannot find channel error
Currently getting this error and have not been able to solve it as of yet. Any ideas?
Not an issue, but I thought it would be helpful to other people to easily run this.
Create a new directory named "slack-bulkinviter", then once in that directory, copied the raw file there:
mkdir slack-bulkinviter && cd $_
curl -O https://raw.githubusercontent.com/robby-dermody/slack-bulkinviter/master/slack-bulkinviter.py
You'll also want to create your apikey.txt
file in this same directory with the contents of your API key.
I then created file named Dockerfile
and pasted in the following contents:
FROM python:3.8.2-buster
RUN pip install --no-cache-dir slacker
COPY slack-bulkinviter.py .
COPY apikey.txt .
Then built the docker image with:
docker build -t slack-bulkinviter .
At this point you should be all set, and can run the script like so:
docker run -it --rm slack-bulkinviter python slack-bulkinviter.py your-channel
Hope this is helpful to someone who doesn't have python already installed on their system, or just wants a clean disposable way to run this script!
Traceback (most recent call last):
File "inviter.py", line 30, in <module>
response = slack.channels.list()
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 212, in list
params={'exclude_archived': exclude_archived})
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 68, in get
return self._request(requests.get, api, **kwargs)
File "/Library/Python/2.7/site-packages/slacker/__init__.py", line 63, in _request
raise Error(response.error)
slacker.Error: invalid_auth
But when I do like here:
from slacker import Slacker
slack = Slacker('<your-slack-api-token-goes-here>')
# Send a message to #general channel
slack.chat.post_message('#general', 'Hello fellow slackers!')
# Get users list
response = slack.users.list()
users = response.body['members']
# Upload a file
slack.files.upload('hello.txt')
It works just fine... I have no experience in Python whatsoever, I've just managed to hack use their initialisation method...
In your README you may want to point folks to the best practice any Slack workspace member can do very quickly directly in Slack. See the Web Applications StackExchange: How do I invite all team members to a new Slack channel?
I'm fine with you assigning this issue to me. I just can't make time for this little pull request today.
—tbc MIT VI-3 '84
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.