From 0806b9474a8bd882b39f73c85a3bd24713c62bdf Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sun, 12 Apr 2020 20:18:45 -0500 Subject: send a more interesting message on failure --- posterbot.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'posterbot.lisp') diff --git a/posterbot.lisp b/posterbot.lisp index be61382..92e6d76 100644 --- a/posterbot.lisp +++ b/posterbot.lisp @@ -42,10 +42,12 @@ is, downloads the image and posts it to the current room." (mxc-uri (upload *posterbot* file-name - (alexandria:read-file-into-byte-vector file-path) + (alexandria:read-file-into-byte-vector file-path) :content-type (make-mime-type word)))) - (send-image-message *posterbot* *room-id* file-name mxc-uri - :info (list :|mimetype| (make-mime-type word))))))) + (if mxc-uri + (send-image-message *posterbot* *room-id* file-name mxc-uri + :info (list :|mimetype| (make-mime-type word))) + (send-text-message *posterbot* *room-id* "I have failed you :(")))))) ;; look for links to images, one word at a time, downloading and ;; posting any images found to the room at the current *ROOM-ID* -- cgit v1.2.3