summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-04-13 08:47:55 -0500
committerColin Okay <cbeok@protonmail.com>2020-04-13 08:47:55 -0500
commit4f90c08f481bf1e60f058983b033cbf26ff0d265 (patch)
tree23a17b1bfa4c23eba63539f5fa90fa2e364bcec8
parentb75b4f3f7b3f9a2cb53ef5720402502a82f431aa (diff)
readme
-rw-r--r--README.org26
1 files changed, 15 insertions, 11 deletions
diff --git a/README.org b/README.org
index 0c5c20d..fdf3076 100644
--- a/README.org
+++ b/README.org
@@ -2,17 +2,21 @@
Build better bots, for matrix!
-* Event Handlers
-** Special Variables
-*** *room-id*
+For an example of a bot made with granolin, see [[https://github.com/cbeo/posterbot][posterbot]]
-The special variable =*room-id*= is available in your =handle-event= methods.
-It will have the value of the Matrix room id in which the event occured. It
-will be =nil= if the event is not a room state nor timeline/message event.
+** TODO Defing a Bot
-For example:
+** TODO Event Handlers
+*** Special Variables
+**** *room-id*
-#+begin_src common-lisp
-(defmethod handle-event :after ((cli echo-bot) (ev text-message-event))
- (send-text-message cli *room-id* (msg-body ev)))
-#+end_src
+ The special variable =*room-id*= is available in your =handle-event= methods.
+ It will have the value of the Matrix room id in which the event occured. It
+ will be =nil= if the event is not a room state nor timeline/message event.
+
+ For example:
+
+ #+begin_src common-lisp
+ (defmethod handle-event :after ((cli echo-bot) (ev text-message-event))
+ (send-text-message cli *room-id* (msg-body ev)))
+ #+end_src