Yes, there are options in relay implementations to setup limits, whitelists or blacklists. Some ways include:
- Blacklisting pubkeys (hard way to do it)
- Blacklisting IP address (A bit simpler, unless the bot uses a proxy list to spam)
- Showing only posts with some leading zero's (Proof of Work) or mined post to slow down spam or discourage.
- Showing only posts with pubkeys created with leading zeros (Proof of Work) - Possible for a spammer to generate multiple PoW pubkeys over time and then do a spam attack later.
- Paid relay (Work in progress - A gateway setup to make lightning payments as one time entry fee or recurring payments to keep spammers away)
- Rate limiting number of events
- Possibly in the future, clients could recognize spam posts and report it to relays to block and relays could gossip with other relays to inform them too.