Bot is operator and can do kill
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 29 Jan 2002 20:38:28 +0000 (20:38 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 29 Jan 2002 20:38:28 +0000 (20:38 +0000)
blight.tcl
bot.tcl
helpinfos
test.tcl

index 6092f9b..a5b4de7 100644 (file)
@@ -8,3 +8,4 @@ set ownmailaddr blight@chiark.greenend.org.uk
 set socketargs {}
 
 source bot.tcl
+source botpass.tcl
diff --git a/bot.tcl b/bot.tcl
index 4685581..06902ab 100755 (executable)
--- a/bot.tcl
+++ b/bot.tcl
@@ -1198,6 +1198,23 @@ def_ucmd identpass {
     ucmdr "Pleased to see you, $username." {}
 }
 
+def_ucmd kill {
+    global nick
+    prefix_nick
+    set target [ta_nick]
+    if {![nickdb_exists $target]} { error "$target is not a registered nick." }
+    set wantu [nickdb_get $target username]
+    if {![string length $wantu]} { error "$target is insecurely registred." }
+    upvar #0 nick_username([irctolower $n]) nu
+    if {![info exists nu]} { error "You must identify yourself first." }
+    if {"$wantu" != "$nu"} {
+       error "You are the wrong user, $nu - $target belongs to $wantu."
+    }
+    set reason "at request of user $nu"
+    if {[ta_anymore]} { append reason "; $text" }
+    sendout KILL $target $reason
+}
+
 def_ucmd summon {
     set target [ta_word]
     ta_nomore
@@ -1369,6 +1386,10 @@ proc ensure_globalsecret {} {
 }
 
 proc connected {} {
+    global operuserpass
+    if {[info exists operuserpass]} {
+       eval sendout OPER $operuserpass
+    }
     foreach chan [chandb_list] {
        if {[chandb_get $chan autojoin]} { dojoin $chan }
     }
index d19544c..2444f93 100644 (file)
--- a/helpinfos
+++ b/helpinfos
@@ -14,6 +14,7 @@ General commands:           Registration and user settings:
  !op [<chan>]                 !channel [<chan>] <setting> [....]
  !leave [<chan>]             Additional help topics:
  !ping [<stuff ...>]          !identify !identpass !invite !blight-id
+ !kill <nick> [<reason>]
 Send commands to me by /msg, or say them in channel with \! in front.
 To get me on a channel, invite me.  To become channel manager, op me.
 
@@ -153,6 +154,12 @@ invite <channel> <nick> ...   privately
  This can be disabled for managed channels - see `help !userinvite'.
 To get me to join a channel, just invite me to it.
 
+:kill
+kill <nick> [<reason>]
+ Asks me to throw that client off IRC completely, using my IRC
+ Operator privilege.  You must have identified yourself as the user
+ to whom the nick is registered.  (See `help !register'.)
+
 :register
 register            register your nick (or make it secure)
 register delete     delete your nick registration
index 5f9b20c..269e2be 100644 (file)
--- a/test.tcl
+++ b/test.tcl
@@ -7,3 +7,4 @@ set socketargs {}
 set marktime_min 10
 
 source bot.tcl
+source botpass.tcl