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

Commit

Permalink
reorangize README
Browse files Browse the repository at this point in the history
  • Loading branch information
lins05 committed Oct 16, 2015
1 parent 059fbf9 commit d9670f1
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ def github():
message.send_webapi('', json.dumps(attachments))
```

### Command Parameter Support

If you would like to have a command like 'stats' and 'stats start_date end_date', you can create reg ex like so:

```python
from slackbot.bot import respond_to
import re


@respond_to('stat$', re.IGNORECASE)
@respond_to('stat (.*) (.*)', re.IGNORECASE)
def stats(message, start_date=None, end_date=None):
```

## Plugins

A chat bot is meaningless unless you can extend/customize it to fit your own use cases.
Expand Down Expand Up @@ -126,6 +112,19 @@ def giveme(message, something):
message.reply('Here is %s' % something)
```

If you would like to have a command like 'stats' and 'stats start_date end_date', you can create reg ex like so:

```python
from slackbot.bot import respond_to
import re


@respond_to('stat$', re.IGNORECASE)
@respond_to('stat (.*) (.*)', re.IGNORECASE)
def stats(message, start_date=None, end_date=None):
```


And add the plugins module to `PLUGINS` list of slackbot settings, e.g. slackbot_settings.py:

```python
Expand Down

0 comments on commit d9670f1

Please sign in to comment.