From 9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 18 Oct 2025 08:42:44 +0300 Subject: Replace bunch of our string utilities with str library --- src/main.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.lisp') 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 @@ (:import-from :com.dieggsy.f-string :enable-f-strings) (:import-from :log) (:import-from :serapeum :drop) + (:import-from :str) (:import-from :ukkoclot/db :with-db) (:import-from :ukkoclot/serializing :fixup-value) (:import-from :ukkoclot/state :make-bot :bot-config :bot-power-on) - (:import-from :ukkoclot/strings - :escape-xml :is-tg-whitespace :is-tg-whitespace-str :starts-with :starts-with-ignore-case) + (:import-from :ukkoclot/strings :escape-xml :is-tg-whitespace :is-tg-whitespace-str) (:local-nicknames (:jzon :com.inuoe.jzon)) (:export :main)) @@ -70,7 +70,7 @@ (defun on-callback-query (bot cb) (let ((data (callback-query-data cb))) (cond ((and data - (starts-with data "bbl:") + (str:starts-with-p "bbl:" data :ignore-case nil) (= (user-id (callback-query-from cb)) (config-owner (bot-config bot)))) (let ((bot-id (read-from-string data t nil :start 4))) @@ -83,7 +83,7 @@ :callback-query-id (callback-query-id cb) :text "OK")) ((and data - (starts-with data "bwl:") + (str:starts-with-p "bwl:" data :ignore-case nil) (= (user-id (callback-query-from cb)) (config-owner (bot-config bot)))) (let ((bot-id (read-from-string data t nil :start 4))) @@ -161,7 +161,7 @@ ((equal text ">:3") (reply-message bot msg ">:3" :parse-mode html)) - ((starts-with-ignore-case text "big ") + ((str:starts-with-p "big " text) (let ((the-text (drop 4 text))) (unless (is-tg-whitespace-str the-text) (reply-message bot msg @@ -190,12 +190,12 @@ (or (message-reply-to-message msg) msg) "dio cane")) - ((starts-with-ignore-case text "say ") + ((str:starts-with-p "say " text) (let ((the-text (drop 4 text))) (unless (is-tg-whitespace-str the-text) (reply-message bot msg the-text)))) - ((starts-with-ignore-case text "tiny ") + ((str:starts-with-p "tiny " text) (let ((the-text (drop 5 text))) (unless (is-tg-whitespace-str the-text) (reply-message bot msg -- cgit v1.2.3