Skip to content

Commit 4163575

Browse files
committed
Merge branch 'master' of github.com:lyuwen/pyslack
2 parents 0b6e53c + b32e8cf commit 4163575

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
11
# pyslack
22

3-
A python to slack interface. It is using Slack legacy tokens.
3+
A command line python base interface to Slack. It uses Slack New App API verion 2.0.
4+
5+
## Install
6+
7+
Create an App on slack and enable `chat:write`, `im:write` and `files:write` permissions.
8+
Install the app, and save the Bot User Token OAuth Access Token to `$HOME/.pyslackrc` from the template `pyslackrc.sample`.
9+
And install the python package.
10+
11+
12+
``` bash
13+
python -m pip install -r requirements.txt
14+
python setup.py build && python setup.py install
15+
16+
```
17+
18+
**or**
19+
20+
``` bash
21+
pip install .
22+
23+
```
424

525
## Usage
626

7-
Copy pyslackrc.sample to `$HOME/.pyslackrc`. And run the program.
27+
* Send a text message.
28+
29+
``` bash
30+
pyslack text --channel #random --text "This is a test message."
31+
```
32+
33+
* Upload a file.
34+
35+
``` bash
36+
pyslack file --channel #random --file /path/to/file --title FileTitle --filetype <file type> \
37+
--initial-comment "This is the comment"
38+
```

0 commit comments

Comments
 (0)