From 657c7e37d2e2844fb5318f0861dbed5cb3271261 Mon Sep 17 00:00:00 2001 From: ijackson Date: Tue, 29 Jan 2002 20:38:28 +0000 Subject: [PATCH] Bot is operator and can do kill --- blight.tcl | 1 + bot.tcl | 21 +++++++++++++++++++++ helpinfos | 7 +++++++ test.tcl | 1 + 4 files changed, 30 insertions(+) diff --git a/blight.tcl b/blight.tcl index 6092f9b..a5b4de7 100644 --- a/blight.tcl +++ b/blight.tcl @@ -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 --- 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 } } diff --git a/helpinfos b/helpinfos index d19544c..2444f93 100644 --- a/helpinfos +++ b/helpinfos @@ -14,6 +14,7 @@ General commands: Registration and user settings: !op [] !channel [] [....] !leave [] Additional help topics: !ping [] !identify !identpass !invite !blight-id + !kill [] 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 ... 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 [] + 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 diff --git a/test.tcl b/test.tcl index 5f9b20c..269e2be 100644 --- a/test.tcl +++ b/test.tcl @@ -7,3 +7,4 @@ set socketargs {} set marktime_min 10 source bot.tcl +source botpass.tcl -- 2.30.2