소스 검색

Minor 'dont-understand' fix

Innocenty Enikeew 10 년 전
부모
커밋
a0714d6f66
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      chatikbot.lisp

+ 5 - 1
chatikbot.lisp

@@ -34,7 +34,11 @@
   (telegram-send-message chat-id
                          (if (and text (zerop (random 5)))
                              (format nil "Сам ~A"
-                                     (replace-all text "@chatikbot" ""))
+                                     (replace-all
+                                      (if (equal (char text 0) #\/)
+                                          (subseq text 1)
+                                          text)
+                                      "@chatikbot" ""))
                              (random-choice *responses*))
                          :reply-to reply-id))
 (defvar *chat-locations* nil "ALIST of chat->location")