summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-10-18 02:24:10 +0300
committerGravatar Uko Kokņevičs2025-10-18 02:24:10 +0300
commit2d3341295e7c505f34e8717acb8ce8bcd907c5f4 (patch)
tree657b3ecce99110589247523118e88b1e8db4f47c /src
parentFix an infinite recursion... (diff)
downloadukkoclot-2d3341295e7c505f34e8717acb8ce8bcd907c5f4.tar.gz
ukkoclot-2d3341295e7c505f34e8717acb8ce8bcd907c5f4.tar.xz
ukkoclot-2d3341295e7c505f34e8717acb8ce8bcd907c5f4.zip
Add "tiny ..." trigger
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp12
-rw-r--r--src/strings.lisp3
2 files changed, 13 insertions, 2 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 9dfdc85..2e01411 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -9,7 +9,7 @@
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-str :starts-with :starts-with-ignore-case) 12 (:import-from :ukkoclot/strings :escape-xml :is-tg-whitespace :is-tg-whitespace-str :starts-with :starts-with-ignore-case)
13 (:local-nicknames 13 (:local-nicknames
14 (:jzon :com.inuoe.jzon)) 14 (:jzon :com.inuoe.jzon))
15 (:export :main)) 15 (:export :main))
@@ -200,6 +200,16 @@
200 (unless (is-tg-whitespace-str the-text) 200 (unless (is-tg-whitespace-str the-text)
201 (reply-message bot msg the-text)))) 201 (reply-message bot msg the-text))))
202 202
203 ((starts-with-ignore-case text "tiny ")
204 (let ((the-text (subseq text 5)))
205 (unless (is-tg-whitespace-str the-text)
206 (reply-message bot msg
207 (map 'string #'(lambda (ch)
208 (if (is-tg-whitespace ch)
209 ch
210 #\.))
211 the-text)))))
212
203 ((string-equal text "uwu") 213 ((string-equal text "uwu")
204 (reply-message bot msg "OwO")) 214 (reply-message bot msg "OwO"))
205 215
diff --git a/src/strings.lisp b/src/strings.lisp
index b11c31c..635762c 100644
--- a/src/strings.lisp
+++ b/src/strings.lisp
@@ -6,6 +6,7 @@
6 (:export 6 (:export
7 :ends-with 7 :ends-with
8 :escape-xml 8 :escape-xml
9 :is-tg-whitespace
9 :is-tg-whitespace-str 10 :is-tg-whitespace-str
10 :lisp->camel-case 11 :lisp->camel-case
11 :lisp->snake-case 12 :lisp->snake-case
@@ -41,7 +42,7 @@
41 (string= gc "Zl") ; Separator, line 42 (string= gc "Zl") ; Separator, line
42 (string= gc "Zp") ; Separator, paragraph 43 (string= gc "Zp") ; Separator, paragraph
43 (string= gc "Cc") ; Other, control 44 (string= gc "Cc") ; Other, control
44 (= (char-code ch) #x2800) ; BRAILLE PATTERN BLANK 45 (= (char-code ch) #x2800) ; BRAILLE PATTERN BLANK
45 ))) 46 )))
46 47
47(defun is-tg-whitespace-str (str) 48(defun is-tg-whitespace-str (str)