|
|
@@ -68,6 +68,7 @@
|
|
|
(:daily (handle-cmd-weather chat-id id '("daily")))
|
|
|
(:rates (handle-cmd-rates chat-id id args))
|
|
|
(:postcheckins (handle-cmd-post-checkins chat-id id args))
|
|
|
+ (:checkins (handle-cmd-checkins chat-id id args))
|
|
|
(otherwise (handle-admin-cmd chat-id text cmd args))))
|
|
|
(send-dont-understand chat-id (preprocess-input text))))
|
|
|
(when location
|
|
|
@@ -213,6 +214,20 @@
|
|
|
(telegram-send-message chat-id (format nil "Теперь палим ~A" user)))))
|
|
|
(setf (gethash chat-id *fsq-send-to*) users)))))
|
|
|
|
|
|
+(defun handle-cmd-checkins (chat-id message-id args)
|
|
|
+ (log:info "handle-cmd-checkins" chat-id message-id args)
|
|
|
+ (handler-case
|
|
|
+ (let ((users (gethash chat-id *fsq-send-to*)))
|
|
|
+ (when users
|
|
|
+ (telegram-send-message
|
|
|
+ chat-id
|
|
|
+ (format nil "~{~A~^~%~}"
|
|
|
+ (loop for checkin in (fsq-fetch-checkins)
|
|
|
+ if (member (aget "id" (aget "user" checkin)) users :test #'equal)
|
|
|
+ collect (fsq-format-checkin checkin t))))))
|
|
|
+ (error (e) (log:error e))))
|
|
|
+
|
|
|
+
|
|
|
(defvar *fsq-seen-ids* nil "Ids of seen checkins")
|
|
|
|
|
|
(defun process-latest-checkins ()
|