summaryrefslogtreecommitdiff
path: root/src/main.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lisp')
-rw-r--r--src/main.lisp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 28c3801..5d3cf76 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -7,11 +7,11 @@
7 (:import-from :com.dieggsy.f-string :enable-f-strings) 7 (:import-from :com.dieggsy.f-string :enable-f-strings)
8 (:import-from :log) 8 (:import-from :log)
9 (:import-from :serapeum :drop) 9 (:import-from :serapeum :drop)
10 (:import-from :str)
10 (:import-from :ukkoclot/db :with-db) 11 (:import-from :ukkoclot/db :with-db)
11 (:import-from :ukkoclot/serializing :fixup-value) 12 (:import-from :ukkoclot/serializing :fixup-value)
12 (:import-from :ukkoclot/state :make-bot :bot-config :bot-power-on) 13 (:import-from :ukkoclot/state :make-bot :bot-config :bot-power-on)
13 (:import-from :ukkoclot/strings 14 (:import-from :ukkoclot/strings :escape-xml :is-tg-whitespace :is-tg-whitespace-str)
14 :escape-xml :is-tg-whitespace :is-tg-whitespace-str :starts-with :starts-with-ignore-case)
15 (:local-nicknames 15 (:local-nicknames
16 (:jzon :com.inuoe.jzon)) 16 (:jzon :com.inuoe.jzon))
17 (:export :main)) 17 (:export :main))
@@ -70,7 +70,7 @@
70(defun on-callback-query (bot cb) 70(defun on-callback-query (bot cb)
71 (let ((data (callback-query-data cb))) 71 (let ((data (callback-query-data cb)))
72 (cond ((and data 72 (cond ((and data
73 (starts-with data "bbl:") 73 (str:starts-with-p "bbl:" data :ignore-case nil)
74 (= (user-id (callback-query-from cb)) 74 (= (user-id (callback-query-from cb))
75 (config-owner (bot-config bot)))) 75 (config-owner (bot-config bot))))
76 (let ((bot-id (read-from-string data t nil :start 4))) 76 (let ((bot-id (read-from-string data t nil :start 4)))
@@ -83,7 +83,7 @@
83 :callback-query-id (callback-query-id cb) 83 :callback-query-id (callback-query-id cb)
84 :text "OK")) 84 :text "OK"))
85 ((and data 85 ((and data
86 (starts-with data "bwl:") 86 (str:starts-with-p "bwl:" data :ignore-case nil)
87 (= (user-id (callback-query-from cb)) 87 (= (user-id (callback-query-from cb))
88 (config-owner (bot-config bot)))) 88 (config-owner (bot-config bot))))
89 (let ((bot-id (read-from-string data t nil :start 4))) 89 (let ((bot-id (read-from-string data t nil :start 4)))
@@ -161,7 +161,7 @@
161 ((equal text ">:3") 161 ((equal text ">:3")
162 (reply-message bot msg "<b>&gt;:3</b>" :parse-mode html)) 162 (reply-message bot msg "<b>&gt;:3</b>" :parse-mode html))
163 163
164 ((starts-with-ignore-case text "big ") 164 ((str:starts-with-p "big " text)
165 (let ((the-text (drop 4 text))) 165 (let ((the-text (drop 4 text)))
166 (unless (is-tg-whitespace-str the-text) 166 (unless (is-tg-whitespace-str the-text)
167 (reply-message bot msg 167 (reply-message bot msg
@@ -190,12 +190,12 @@
190 (or (message-reply-to-message msg) msg) 190 (or (message-reply-to-message msg) msg)
191 "dio cane")) 191 "dio cane"))
192 192
193 ((starts-with-ignore-case text "say ") 193 ((str:starts-with-p "say " text)
194 (let ((the-text (drop 4 text))) 194 (let ((the-text (drop 4 text)))
195 (unless (is-tg-whitespace-str the-text) 195 (unless (is-tg-whitespace-str the-text)
196 (reply-message bot msg the-text)))) 196 (reply-message bot msg the-text))))
197 197
198 ((starts-with-ignore-case text "tiny ") 198 ((str:starts-with-p "tiny " text)
199 (let ((the-text (drop 5 text))) 199 (let ((the-text (drop 5 text)))
200 (unless (is-tg-whitespace-str the-text) 200 (unless (is-tg-whitespace-str the-text)
201 (reply-message bot msg 201 (reply-message bot msg