Version 0.1.8
A Python package for sending messages to Slack
- Python 3.x
- pip for Python 3.x
- Incoming webhook for the Slack app
Note: This guide assumes that only one Python version is installed, namely Python 3.x, and that the executables are
python
andpip
. In case Python 3.x is installed aspython3
(for example, when Python 2.x is installed aspython
), the keywordspython
andpip
need to be replaced bypython3
andpip3
respectively.
To install with pip
, run
pip install slack-cli-webhook
Alternatively, the package can be installed from source:
python3 -m pip install --user --upgrade setuptools wheel
git clone https://github.com/Matthiti/slack-cli-webhook.git
cd slack-cli-webhook
python3 setup.py install
To get an idea of how to use this tool, you can use -h
or --help
:
python -m slack-cli-webhook --help
usage: python -m slack-cli-webhook [-h] -m MESSAGE -w WEBHOOK
optional arguments:
-h, --help show this help message and exit
-m MESSAGE, --message MESSAGE
message to send
-w WEBHOOK, --webhook WEBHOOK
webhook to send to
A message can be specified with the -m
or --message
properties. Note that characters needs to be properly escaped. In addition to the message, a webhook needs to be provided to send the message to using -w
or --webhook
.
python -m slack-cli-webhook -m "Test" -w "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"