added user abort handling
This commit is contained in:
parent
453a82d81d
commit
f63c968a93
|
@ -6,7 +6,7 @@
|
|||
:license "NPLv1+"
|
||||
:version "0.0.1"
|
||||
:serial t
|
||||
:depends-on (#:glacier)
|
||||
:depends-on (#:glacier #:with-user-abort)
|
||||
:components ((:file "package")
|
||||
(:file "out-of-touch-bot"))
|
||||
:entry-point "out-of-touch-bot:main"
|
||||
|
|
|
@ -6,7 +6,13 @@
|
|||
(unless (uiop:file-exists-p "video.mp4")
|
||||
(format t "wha- where's the out of touch thursdays video? ;w;")
|
||||
(uiop:quit 1))
|
||||
(run-bot ((make-instance 'mastodon-bot :config-file "config.file")
|
||||
:with-websocket nil)
|
||||
(on (:thursday :at "11:00")
|
||||
(post "its out of touch thursdays!" :visibility :public :media "video.mp4"))))
|
||||
(handler-case
|
||||
(with-user-abort
|
||||
(run-bot ((make-instance 'mastodon-bot :config-file "config.file")
|
||||
:with-websocket nil)
|
||||
(on (:thursday :at "11:00")
|
||||
(post "its out of touch thursdays!" :visibility :public :media "video.mp4"))))
|
||||
(user-abort ()
|
||||
(uiop:quit))
|
||||
(error (e)
|
||||
(format t "error: ~a~%" e))))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;;; package.lisp
|
||||
|
||||
(defpackage #:out-of-touch-bot
|
||||
(:use #:cl #:glacier)
|
||||
(:use #:cl #:glacier #:with-user-abort)
|
||||
(:export :main))
|
||||
|
|
Reference in New Issue