summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-04-12 16:37:25 -0500
committerColin Okay <cbeok@protonmail.com>2020-04-12 16:37:25 -0500
commit2e7c31b591497ea71f92cb816c8ec0fc23a616ab (patch)
tree19f944a32d8eba4179808b321cc6c5d706978e9e
parent3fb6ad19bcc102b397702d9b9de3ed6c59c8485a (diff)
doc
-rw-r--r--README.org5
-rw-r--r--posterbot.lisp2
2 files changed, 6 insertions, 1 deletions
diff --git a/README.org b/README.org
index 0bbb092..c230c53 100644
--- a/README.org
+++ b/README.org
@@ -21,7 +21,10 @@ git checkout origin/develop
(in-package :posterbot)
-(let ((bot (make-instance 'posterbot :ssl nil :user-id "mybotaccount" :homeserver "localhost:8008")))
+(let ((bot (make-instance 'posterbot
+ :ssl nil
+ :user-id "mybotaccount"
+ :homeserver "localhost:8008")))
(login bot "mybotaccount" "mypassword")
(start bot))
diff --git a/posterbot.lisp b/posterbot.lisp
index d2d3531..be61382 100644
--- a/posterbot.lisp
+++ b/posterbot.lisp
@@ -33,6 +33,8 @@ the downloaded file."
(t type)))))
(defun handle-link-candiate (word)
+ "Checks if WORD is an HTTP URI pointing to an image resource. If it
+is, downloads the image and posts it to the current room."
(let ((link (ppcre:scan-to-strings +image-link-regex+ word)))
(when link
(let* ((file-path (download-link link))