TCL BadWords

BadWords

# Badword Kick by KuNgFo0

set badwords {
 "shit"
 "damn"
 "fuck"
 "crap"
 "hell"
 "bitch"
}
# Kick MSG
set badword_msg "Bad Words"

# Channels
set badword_chans "#test #test1"

bind pubm - * pubm_badword
bind ctcp - ACTION ctcp_badword 

putlog "Badword loaded"

proc pubm_badword {nick uhost hand chan arg} {
	global badwords badword_msg badword_chans botnick
	if {(([lsearch -exact [string tolower $badword_chans] [string tolower $chan]] != -1) || ($badword_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
		foreach badword [string tolower $badwords] {
			if {[string match *$badword* [string tolower $arg]]} {
				putserv "KICK $chan $nick :$badword_msg"
				return
			}
		}
	}
}
proc ctcp_badword {nick uhost hand chan keyword arg} {
	pubm_badword $nick $uhost $hand $chan $arg
}