Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit 059fbf9

Browse files
committed
Merge pull request scrapinghub#35 from kienpham2000/command-params
accpeting params for command
2 parents 140461d + d7274f1 commit 059fbf9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ def github():
7171
}]
7272
message.send_webapi('', json.dumps(attachments))
7373
```
74+
75+
### Command Parameter Support
76+
77+
If you would like to have a command like 'stats' and 'stats start_date end_date', you can create reg ex like so:
78+
79+
```python
80+
from slackbot.bot import respond_to
81+
import re
82+
83+
84+
@respond_to('stat$', re.IGNORECASE)
85+
@respond_to('stat (.*) (.*)', re.IGNORECASE)
86+
def stats(message, start_date=None, end_date=None):
87+
```
7488

7589
## Plugins
7690

0 commit comments

Comments
 (0)