proc pub_subspam { nick host hand chan vars } {
  if {![issubop [nick2subop $nick]]} {return 1}
  if {![issubopchan $chan]} {return 1}
  set vict [lindex [split $vars] 0]
  set reason [lrange $vars 1 end]
  set spamhost "*!*@[lindex [split [getchanhost $nick $chan] "@"] end]"
  if {![onchan $vict $chan]} {return 1}
  if {[matchattr [nick2hand $vict $chan] f|f $chan]} {return 1}
  newban $spamhost $nick $reason \%30d
  putserv "KICK $chan $vict :\002banned for spamming\002"
  putlog "Sub-op \002[nick2subop $nick]\002 (nick $nick) kick-banned \002$vict\002 from \002$chan\002 with reason \"\002banned
for spamming\002\"."
}

This is the code, in makes the bot ban *!*@* befor banning the actual host.. 
[getchanhost $nick $chan] is wrong, the $nick makes the bot ban the one trigger the TCL.
not the one it should ban.. 