# *** Configuration *** #
# duration of bans in minutes
set vHolmBanTime 10
# global bot flag to exempt from bad topic ban
# o = global operator
# m = global master
# n = global owner
set vHolmExemptFlag n
# list of bad topic words/phrases
set vHolmBadTopic {
"html"
"#"
"www"
"channel"
}
# *** Code *** #
setudef flag topic
bind PUB - !topic pHolmTopic
proc pHolmTopic {nick uhost handle channel txt} {
global botnick vHolmBadTopic vHolmBanTime vHolmExemptFlag
if {[channel get $channel topic]} {
if {([isvoice $nick $channel]) || ([isop $nick $channel])} {
set topic [string trim $txt]
if {[llength [split $topic]] != 0} {
if {[botisop $channel]} {
if {![matchattr $handle $vHolmExemptFlag]} {
foreach word $vHolmBadTopic {
if {[string match *$word* $txt]} {
newchanban $channel $nick!*@* $botnick "bad topic *$word*" $vHolmBanTime
return 0
}
}
}
putserv "TOPIC $channel :$nick \:$topic"
putlog "#$nick# !topic $topic"
} else {puthelp "NOTICE $nick :-error- I need to be an op on $channel to change the topic"}
} else {puthelp "NOTICE $nick :-error- Correct syntax is !topic <topic>"}
} else {puthelp "NOTICE $nick :-error- Only channel voices or above are allowed to change the topic"}
}
return 0
}
I'm sure stuff like this has been written before in the vast Tcl archive on this site. I sort of feel I'm reinventing the wheel.