Do you mean spamming of channel thru pm?
You could use
on *:TEXT:*:?: if ($wildtok($strip($1-),#*,0,32)) close -m $nick
or
on ^*:OPEN:?:*: if ($wildtok($strip($1-),#*,0,32)) haltdef
The difference is, in the TEXT event, you would see a window flash if it detects a channel name being said in pm and in the OPEN event doesn't. On OPEN event works best if there is no window yet for that person who pm'd you. Hope this is what you're looking for.