aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7a75823..4999174 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,25 @@ for message in s.receive_messages():
print(message)
```
+You can also use the chat decorator interface:
+
+```python
+from signald import Signal
+
+s = Signal("+1234567890")
+
+@s.chat_handler("hello") # This is case-insensitive.
+def hello(message, match):
+ return "Hello there!"
+
+
+@s.chat_handler(re.compile("my name is (.*)")) # This is case-sensitive.
+def name(message, match):
+ return "Hello %s." % match.group(1)
+
+
+s.run_chat()
+```
Various
-------