demos: ircbot: Do not assume /usr/bin/guile.
[8sync.git] / demos / ircbot.scm
index c1c573e08ac24983ddda378c9cde95fc08605633..32b0d1fd557ad21bfecaccf6e3acf93af3a8b79c 100755 (executable)
@@ -1,9 +1,9 @@
-#!/usr/bin/guile \
+#! /usr/bin/env guile \
 -e main -s
 !#
 
 ;;; 8sync --- Asynchronous programming for Guile
-;;; Copyright (C) 2015 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2015, 2016, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of 8sync.
 ;;;
@@ -30,8 +30,8 @@
 
 (define-class <my-irc-bot> (<irc-bot>))
 
-(define-method (handle-line (irc-bot <my-irc-bot>) speaker channel
-                            line emote?)
+(define-method (handle-line (irc-bot <my-irc-bot>) message
+                            speaker channel line emote?)
   (define my-name (irc-bot-username irc-bot))
   (define (looks-like-me? str)
     (or (equal? str my-name)
      (repl
       (bootstrap-actor* hive <repl-manager> "repl"))))
 
-  (define initial-messages
-    (if repl
-        (list (bootstrap-message hive irc-bot 'init)
-              (bootstrap-message hive repl-manager 'init))
-        (list (bootstrap-message hive irc-bot 'init))))
-
   ;; TODO: load REPL
-  (run-hive hive initial-messages))
+  (run-hive hive '()))
 
 (define (main args)
   (define parsed-args (parse-args "ircbot.scm" args))