diff --git a/Chanban/chanban.tcl b/Chanban/chanban.tcl index 9121433..4335bbc 100644 --- a/Chanban/chanban.tcl +++ b/Chanban/chanban.tcl @@ -30,7 +30,7 @@ namespace eval cmgmt { # so your command must read from stdin variable upCommand "curl -s -F file=@- https://x0.at/" - # Set the banmask to use in banning the user + # Set the banmask type to use in banning the user # Available types are: # 0 *!user@host # 1 *!*user@host @@ -44,8 +44,9 @@ namespace eval cmgmt { # 9 nick!*@*.host variable banMask "2" - # Channel flag to auto add bans to the bot ban list - setudef flag addBans + # Mask type to use to track hostmasks that should not trigger auto adding bans + # Same type as banMask + variable noAddType "1" # Nicks to ignore for auto adding bans variable noAddNicks { @@ -87,6 +88,9 @@ namespace eval cmgmt { bind mode * "*+b*" ::cmgmt::abans bind mode * "*-b*" ::cmgmt::rbans + # Channel flag to auto add bans to the bot ban list + setudef flag addBans + # ---------- # End of configuration # ---------- @@ -96,14 +100,14 @@ namespace eval cmgmt { # # If you touch the code below and then complain the script "suddenly stopped working" I'll touch you at night. # ---------- - variable scriptName "Channel Management v1.0 \(01/03/2026-18:21\) by PeGaSuS" + variable scriptName "Channel Management v1.0 \(01/03/2026-22:21\) by PeGaSuS" # ---------- # Auto add bans # ---------- proc abans {nick uhost hand chan mode target} { putlog "DEBUG autobans: nick=$nick chan=$chan mode=$mode target=$target" - set hostmask [maskhost ${nick}![getchanhost $nick $chan] 2] + set hostmask [maskhost ${nick}![getchanhost $nick $chan] $::cmgmt::noAddType] set banReason "$::cmgmt::banReason \(auto-added\)" if {![channel get $chan addBans]} { @@ -149,6 +153,7 @@ namespace eval cmgmt { # and make them sticky so the bot doesn't remove them bind cron * "*/5 * * * *" ::cmgmt::addextbans proc addextbans {minute hour day month weekday} { + putlog "Adding existing extbans to banlist" foreach chan [channels] { foreach cban [chanbans $chan] { set mask [lindex [split $cban] 0] @@ -302,6 +307,7 @@ namespace eval cmgmt { } set cbans [banlist $chan] + set cbans [lsearch -all -inline -not -index 1 $cbans "EXTBAN"] if {$cbans eq ""} { putserv "PRIVMSG $chan :ERROR! ${chan}'s ban list is empty." return 0 @@ -611,6 +617,7 @@ namespace eval cmgmt { } set cbans [banlist $chan] + set cbans [lsearch -all -inline -not -index 1 $cbans "EXTBAN"] if {$cbans eq ""} { putserv "PRIVMSG $nick :ERROR! ${chan}'s ban list is empty." return 0