chiark / gitweb /
Produce error if you say "register spong". Change mustpingbefore to muststartby...
[ircbot] / usebnbot.tcl
index f7a1ed4ca9011a4c8083876eb956cd85bcb708e2..8e227c6a8a00eb6089150c1222443cd1751844f8 100644 (file)
@@ -18,13 +18,13 @@ proc bnbot__vars {} {
 }
 
 def_bnbot ensure_connecting {} {
-    global musthaveping_ms bnbot
+    global muststartby_ms bnbot
     
     if {[info exists bnchan]} return
     defset bnport 6112
     set bnchan [open [list | $bnbot $bnhost $bnport] w+]
     fconfigure $bnchan -buffering line
-    set bnmbokafter [after $musthaveping_ms \
+    set bnmbokafter [after $muststartby_ms \
            "fail {bot $botid not ok within timeout}"]
     set bnstate Connected
     fileevent $bnchan readable [list bnbot_onread $botid]
@@ -69,7 +69,7 @@ def_bnbot onread {args} {
     } elseif {[regexp {^1007 CHANNEL "(.*)"} $l dummy bnchanfn]} {
        after cancel $bnmbokafter
        unset bnmbokafter
-    } elseif {![string length $bnstate]} {
+    } elseif {[info exists bnchanfn]} {
        bnbot_event $botid $l
     }
 }