X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=demos%2Fircbot.scm;h=bfcd723fca8f9722b014192c75d48e366dd35748;hp=ec381f0b83ea3b03b356fdc9e3b6eaed85a270a6;hb=bc24c9f3f29d3396ae9e52f9682914dec868838a;hpb=3e27bb39df3dbaf65bd0581131610bfe6c824720 diff --git a/demos/ircbot.scm b/demos/ircbot.scm index ec381f0..bfcd723 100755 --- a/demos/ircbot.scm +++ b/demos/ircbot.scm @@ -22,10 +22,14 @@ (use-modules (8sync) (8sync systems irc) + (oop goops) (srfi srfi-37) (ice-9 match)) -(define (handle-line irc-bot speaker channel line emote?) +(define-class ()) + +(define-method (irc-bot-handle-line (irc-bot ) speaker channel + line emote?) (define my-name (irc-bot-username irc-bot)) (define (looks-like-me? str) (or (equal? str my-name) @@ -95,9 +99,7 @@ (repl #f)) (define hive (make-hive)) (define irc-bot - (hive-create-actor* hive "irc-bot" - #:line-handler handle-line - ;; TODO: move these to argument parsing + (hive-create-actor* hive "irc-bot" #:username username #:server server #:channels channels)) @@ -105,7 +107,7 @@ (ez-run-hive hive (list (bootstrap-message hive irc-bot 'init)))) (define (main args) - (define parsed-args (parse-args "ircbot.scm" (pk 'args args))) + (define parsed-args (parse-args "ircbot.scm" args)) (apply (lambda* (#:key username #:allow-other-keys) (when (not username) (display "Error: username not specified!")