PageRenderTime 18ms CodeModel.GetById 8ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/freenode-main.rkt

http://github.com/elibarzilay/rudybot
Shell | 34 lines | 25 code | 4 blank | 5 comment | 0 complexity | efb2ebd0e42ce7a408195eeee4a1a582 MD5 | raw file
 1#! /bin/sh
 2#| Hey Emacs, this is -*-scheme-*- code!
 3exec racket -l errortrace --require "$0" --main -- ${1+"$@"}
 4|#
 5
 6#lang racket
 7
 8(require "loop.rkt"
 9         (except-in "vars.rkt" log)
10         "git-version.rkt"
11         (except-in "clearenv.rkt" main)
12         (only-in "servers.rkt" real-server)
13         (only-in "userinfo.rkt" *userinfo-database-directory-name*)
14         (only-in "iserver.rkt" make-incubot-server))
15
16(define (main . args)
17  (clearenv)
18  (command-line
19   #:program "rudybot"
20   #:once-each)
21
22  (log "Main starting: ~a" (git-version))
23  (parameterize* ([*irc-server-hostname* "irc.freenode.org"]
24                  [*irc-server-port* 6667]
25                  [*userinfo-database-directory-name* "userinfo.db"]
26                  [*incubot-logger* log]
27                  [*incubot-server* (make-incubot-server "parsed-log")]
28                  [*nickserv-password* (get-preference '|rudybot-freenode-nickserv-password|)])
29
30    (if (*nickserv-password*)
31        (connect-and-run real-server)
32        (error 'freenode-main "You didn't specify a NickServ password"))))
33
34(provide (all-defined-out))