@@ -75,6 +75,9 @@
(bordeaux-threads:destroy-thread old-updates))))
(defun start ()
+ ;; Test telegram token
+ (setf *bot-name* (concatenate 'string "@" (aget "username" (telegram-get-me))))
+
(cleanup)
;; Run 'starting' hooks to set up schedules
@@ -1,8 +1,5 @@
(in-package #:chatikbot)
-;; Bot
-(setf *bot-name* "@chatikbot")
-
;; Telegram
(setf *telegram-token* "123456789:YourTokenHere")
@@ -1,7 +1,7 @@
;; Load pattern matching facility
-(load "patmatch.lisp")
+(load "plugins/patmatch.lisp")
(defparameter *fuck-off*
'((отъебись) (мне похуй) (ебаный ты нахуй!))
@@ -31,6 +31,9 @@
(cons "limit" limit)
(cons "timeout" timeout))))
+(defun telegram-get-me ()
+ (%telegram-api-call "getMe"))
(defun telegram-send-message (chat-id text &key parse-mode disable-web-preview reply-to reply-markup)
(%telegram-api-call
"sendMessage"
@@ -1,6 +1,6 @@
-(defvar *bot-name* "@chatikbot" "bot name to properly handle text input")
+(defvar *bot-name* nil "bot name to properly handle text input")
(defvar *hooks* (make-hash-table) "Hooks storage")