summaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorthegoofist <49315797+thegoofist@users.noreply.github.com>2019-10-04 13:35:43 -0500
committerGitHub <noreply@github.com>2019-10-04 13:35:43 -0500
commit1fa9a1fc8cef784680bea4336f4ba4bed6185235 (patch)
tree8dc4ca0b56266672cc2e826a3c218c2911849e2e /README.org
parente5b24b5eac031b68712c75b463a0e138b617b02d (diff)
parent58f698906747f5285ce6f6344eea96e05a6931a6 (diff)
Merge pull request #10 from thegoofist/room-event-id
Clean: *room-id* special var refactoring handle-event generic
Diffstat (limited to 'README.org')
-rw-r--r--README.org18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..0c5c20d
--- /dev/null
+++ b/README.org
@@ -0,0 +1,18 @@
+* Granolin
+
+Build better bots, for matrix!
+
+* Event Handlers
+** Special Variables
+*** *room-id*
+
+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