 (defn stop []
   (p/stop @channel))
 
+(defn restart []
+  (do (stop)
+      (start)))
+
 (defn -main
   "I don't do a whole lot ... yet."
   []

(defn check-remaining []
  (if (session-alive? @state)
    (send-remaining (:message-id @state) "manual")
    (send-m "타이머가 돌고 있지 않음")))

(defn cancel-timer []
  (if (session-alive? @state)
    (do
      (future-cancel (:timer @state))
      (future-cancel (:interval @state))
      (swap! state assoc :timer nil)
      (send-m (str (:mode @state) " 취소되었습니다")))
    (send-m "진행중인 태스크가 없습니다")))

(defn send-counted [counted]
  (send-m (str counted)))

(defhandler bot-api
            (command "go" [] (timer-start))
            (command "check" [] (check-remaining))
            (command "count" [] (send-counted @counted))
            (command "cancel" [] (cancel-timer)))

(def channel (atom nil))


  (future (while true (do (Thread/sleep ms) (callback)))))

(defn set-timeout [callback ms]
  (future (do (Thread/sleep ms)
              (swap! state assoc :timer nil)
              (callback))))


(defn send-m
