summaryrefslogtreecommitdiff
path: root/src/main.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lisp')
-rw-r--r--src/main.lisp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 2e01411..ba3e343 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -9,7 +9,8 @@
9 (:import-from :ukkoclot/db :with-db) 9 (:import-from :ukkoclot/db :with-db)
10 (:import-from :ukkoclot/serializing :fixup-value) 10 (:import-from :ukkoclot/serializing :fixup-value)
11 (:import-from :ukkoclot/state :make-bot :bot-config :bot-power-on) 11 (:import-from :ukkoclot/state :make-bot :bot-config :bot-power-on)
12 (:import-from :ukkoclot/strings :escape-xml :is-tg-whitespace :is-tg-whitespace-str :starts-with :starts-with-ignore-case) 12 (:import-from :ukkoclot/strings
13 :escape-xml :is-tg-whitespace :is-tg-whitespace-str :starts-with :starts-with-ignore-case)
13 (:local-nicknames 14 (:local-nicknames
14 (:jzon :com.inuoe.jzon)) 15 (:jzon :com.inuoe.jzon))
15 (:export :main)) 16 (:export :main))
@@ -26,7 +27,9 @@
26(defun start-swank (port) 27(defun start-swank (port)
27 (log:info "Starting a SWANK server on port ~A..." port) 28 (log:info "Starting a SWANK server on port ~A..." port)
28 (swank:create-server :port port :dont-close t) 29 (swank:create-server :port port :dont-close t)
29 (log:info "SWANK started. You can connect to it by forwarding ports via SSH: `ssh -L~A:127.0.0.1:~A username@server.com'" port port) 30 (log:info
31 "SWANK started. You can connect to it by forwarding ports via SSH: `ssh -L~A:127.0.0.1:~A username@server.com'"
32 port port)
30 (log:info "And then afterwards M-x slime-connect giving localhost and ~A" port)) 33 (log:info "And then afterwards M-x slime-connect giving localhost and ~A" port))
31 34
32(defun stop-swank (port) 35(defun stop-swank (port)
@@ -214,9 +217,10 @@
214 (reply-message bot msg "OwO")) 217 (reply-message bot msg "OwO"))
215 218
216 ((string-equal text "waow") 219 ((string-equal text "waow")
217 (reply-message bot 220 (reply-message
218 (or (message-reply-to-message msg) msg) 221 bot
219 "BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED")) 222 (or (message-reply-to-message msg) msg)
223 "BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED BASED"))
220 224
221 ((string-equal text "what") 225 ((string-equal text "what")
222 (reply-message bot msg 226 (reply-message bot msg
@@ -232,8 +236,7 @@
232 (write-string "GIR" s)) 236 (write-string "GIR" s))
233 (if (char= (elt text 3) #\t) 237 (if (char= (elt text 3) #\t)
234 (write-char #\l s) 238 (write-char #\l s)
235 (write-char #\L s))))) 239 (write-char #\L s))))))))
236 )))
237 240
238(defun simplify-cmd (bot cmd) 241(defun simplify-cmd (bot cmd)
239 (let ((at-idx (position #\@ cmd))) 242 (let ((at-idx (position #\@ cmd)))
@@ -273,9 +276,7 @@ Send time: ..."))
273 (message-from msg) 276 (message-from msg)
274 (= (user-id (message-from msg)) (config-owner (bot-config bot)))) 277 (= (user-id (message-from msg)) (config-owner (bot-config bot))))
275 (setf (bot-power-on bot) nil) 278 (setf (bot-power-on bot) nil)
276 (reply-message bot msg "Initialising shutdown..." :allow-sending-without-reply t)) 279 (reply-message bot msg "Initialising shutdown..." :allow-sending-without-reply t)))))
277
278 )))
279 280
280(defun report-error (bot evt err) 281(defun report-error (bot evt err)
281 (log:error "While handling ~A: ~A" evt err) 282 (log:error "While handling ~A: ~A" evt err)