(defun gen-stib-vars (stibs &optional (stream *standard-output*)) (flet ((gen-stib-var (stib) (with-accessors ((height height) (mimetype mimetype) (thumbnail-url thumbnail-url) (url url) (width width) (name name) (unique-id unique-id)) stib (ps:ps-to-stream stream (ps:lisp (format stream "var ~A;" (string-downcase unique-id))) (setf (ps:lisp unique-id) (ps:create api "fromWidget" action "m.sticker" widget-id "stickerpicker" request-id "sticker-ready" data (ps:create content (ps:create body (ps:lisp name) info (ps:create w (ps:lisp width) h (ps:lisp height) mimetype (ps:lisp mimetype) thumbnail_url (ps:lisp thumbnail-url)) url (ps:lisp url))))))))) ;; (ps:chain window parent (post-message (ps:lisp unique-id) "*")))))) (mapcar (lambda (stib) (gen-stib-var stib) (format stream "~%~%")) stibs)))