Hi, I hope your day and week is going well.
There is a quite complex extension that maybe can work for you: Auto Moderator.
With this extension you should be able to set some rules like when X happen do Y.
I don't use and know personally this extension, you can try to read the relative link and ask in the extension discussion if you have questions about it.
Other tools to prevent spam can be found here: