This repository was archived by the owner on Jul 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -72,20 +72,6 @@ def github():
72
72
message.send_webapi(' ' , json.dumps(attachments))
73
73
```
74
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
- ```
88
-
89
75
## Plugins
90
76
91
77
A chat bot is meaningless unless you can extend/customize it to fit your own use cases.
@@ -126,6 +112,19 @@ def giveme(message, something):
126
112
message.reply(' Here is %s ' % something)
127
113
```
128
114
115
+ If you would like to have a command like 'stats' and 'stats start_date end_date', you can create reg ex like so:
116
+
117
+ ``` python
118
+ from slackbot.bot import respond_to
119
+ import re
120
+
121
+
122
+ @respond_to (' stat$' , re.IGNORECASE )
123
+ @respond_to (' stat (.*) (.*)' , re.IGNORECASE )
124
+ def stats (message , start_date = None , end_date = None ):
125
+ ```
126
+
127
+
129
128
And add the plugins module to ` PLUGINS ` list of slackbot settings, e.g. slackbot_settings.py:
130
129
131
130
``` python
You can’t perform that action at this time.
0 commit comments