A command line python base interface to Slack. It uses Slack New App API verion 2.0.
Create an App on slack and enable chat:write
, im:write
and files:write
permissions.
Install the app, and save the Bot User Token OAuth Access Token to $HOME/.pyslackrc
from the template pyslackrc.sample
.
And install the python package.
python -m pip install -r requirements.txt
python setup.py build && python setup.py install
or
pip install .
-
Send a text message.
pyslack text --channel '#random' --text "This is a test message."
-
Upload a file.
pyslack file --channel '#random' --file /path/to/file --title FileTitle --filetype <file type> \ --initial-comment "This is the comment"