simplest way, but only in servers that support the +b ~c:#channel
unreal IRCd has it, so most likely the server you are on will support it.
ex:
someone on #spammernation is trying to join your channel, and starts flooding,
you can place a ban on ~c:#spammernation
if there are channels that have spam in them, or their name keeps chaning do a +b ~c:#*spam*
and if someone is on #nospam and they are your frends, you can do a +e #nospam, but mind that then the spammers may join that channel and join yours.