You'd be best off using a user list here. You can add a user's host or nick to a user list with /guser or /auser, respectively.
You can then check if the user is matched with a specific named user level in an event by specifying the named level in the event, such as:
on @spammers:join:#:{
ban # $nick 2
kick # $nick Spam bot
}
By typing
/help user list, you can learn a bit more about them. I'd recommend using /guser (and mask level 2), as the nicks are probably randomly generated.