~williewillus/r16

6b8c112f637c789c9c9d02b7b701f68ab015460e — Vincent Lee a month ago ac7acc9
Go back to bot token as an env var, enforce an empty set of env vars in sandboxes
3 files changed, 5 insertions(+), 12 deletions(-)

M README.md
M evaluator.rkt
M r16.rkt
M README.md => README.md +2 -3
@@ 20,7 20,6 @@ number to "16".
## Usage
1. Clone this repository
2. `raco pkg install --user --auto --type dir <clone directory>`
3. Put your bot token in a file called `token` in the current working directory
4. `racket r16.rkt`
3. `BOT_TOKEN=<your discord token> racket r16.rkt`

Tricks will be saved in the current working directory in an unspecified format.
Tricks will be saved in a subdirectory of the current working directory in an unspecified format.

M evaluator.rkt => evaluator.rkt +2 -1
@@ 77,7 77,8 @@
         (results (call-with-values
                   (thunk
                    (with-handlers ([(const #t) identity])
                      (evaluator code)))
                      (parameterize ([current-environment-variables (make-environment-variables)])
                        (evaluator code))))
                   list))
         (stdout (get-output evaluator))
         (stderr (get-error-output evaluator)))

M r16.rkt => r16.rkt +1 -8
@@ 427,13 427,6 @@
    (rc:on-event 'message-create client (message-received db))
    client))

(define (get-token)
  (let* ([port (open-input-file "token")]
         [token (read-line port)])
    (close-input-port port)
    token))


(define (main)
  (define discord-receiver (make-log-receiver rc:discord-logger 'debug))
  (define r16-receiver (make-log-receiver r16-logger 'debug))


@@ 446,7 439,7 @@
                (vector-ref v 1)))
      (loop))))
  (set! start-time (current-seconds))
  (rc:start-client (init-client (get-token))))
  (rc:start-client (init-client (getenv "BOT_TOKEN"))))

(module* main #f
  (main))