(module vandusen-control () (import chicken scheme) (use vandusen irc) (plugin 'control (lambda () (define (prefix-channel channel) (if (eq? #\# (string-ref channel 0)) channel (string-append "#" channel))) (define (channel-command action message) (lambda (m channel) (let ((channel (if (eq? #\# (string-ref channel 0)) channel (string-append "#" channel)))) (call-with-connection (cut action <> channel)) (reply-to m (string-append message " " channel) method: irc:action)))) (command 'join `(: "join" (+ space) (submatch (+ any))) (channel-command irc:join "has joined")) (command 'leave `(: "leave" (+ space) (submatch (+ any))) (channel-command irc:leave "has left")))) )