add test post flag

This commit is contained in:
xenia 2020-09-01 03:49:12 -04:00
parent 6e399e6c43
commit 5a7730e095
1 changed files with 15 additions and 4 deletions

View File

@ -68,8 +68,19 @@
(path->string (path->complete-path (find-system-path 'run-file)))))
(parameterize ([current-config (config-from-file "config.rktd")])
(run-bot)
(schedule-next)
(define selftest (make-parameter #f))
(void))
(command-line
#:program "awoobot"
#:once-each
[("-t" "--test") "Send a test post" (selftest #t)]
#:args ()
(parameterize ([current-config (config-from-file "config.rktd")])
(if (selftest)
(begin
(displayln "testing config")
(send-toot/retry-on-err (make-toot "test post pls ignore,")))
(begin
(run-bot)
(schedule-next)))
(void)))