summaryrefslogtreecommitdiff
path: root/granolin.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'granolin.lisp')
-rw-r--r--granolin.lisp9
1 files changed, 6 insertions, 3 deletions
diff --git a/granolin.lisp b/granolin.lisp
index cff0970..8ff860a 100644
--- a/granolin.lisp
+++ b/granolin.lisp
@@ -412,6 +412,7 @@
(setf (room-state-event-data *state-event*) ob)
(handle-event client room-id *state-event*))))
+
(defun process-invited-room-events (client)
(let ((invite-event (make-invitation-event :data nil)))
(loop :for (room-id room . ignore) :on (invited-rooms *response-object*) :by #'cddr :do
@@ -421,11 +422,12 @@
(handle-event client room-id invite-event)))))
-(defun send-text-message (client room-id message)
- "Sends the MESSAGE (a string) to the room with id ROOM-ID."
+(defun send-text-message (client room-id message &rest args)
+ "Sends the MESSAGE (a string) to the room with id ROOM-ID. MESSAGE can also be
+ a format string, and ARGS is "
(let ((url (format nil +text-message-path+ room-id (txn-id client)))
(body (list :|msgtype| "m.text"
- :|body| message)))
+ :|body| (apply #'format (list* nil message args)))))
(send (client url body :wrap make-basic-json) t)))
@@ -440,6 +442,7 @@
*response-status*
(flexi-streams:octets-to-string *response-body*)))))
+
;;; bot loop
(defun start (client)