Now that we've discussed this a bit, I feel like email verification would actually go a long way toward solving this problem. @nilly brought up a good point that bots could still be registered manually, so providing a simple captcha wouldn't be enough. Therefore, they could mark all existing accounts above 1 star as having been verified, and require all new accounts to get verification before they can chat. An email is literally required when you register, so even though rotmg caters to a younger audience it's assumed that they already have one before they play. New users can also still play as guests.
Of course, after they add in registration to solve the immediate spamming epidemic, they need to seriously think about having a report player feature, with a drop down for the reason. If enough people flag an account in a medium amount of time for the same offense, it'll lead to a suspension or a ban. As a very quick hack, they could even have it done from the chat command line, such as /report player_name [reason].
@JustAnoobROTMG
I haven't thought too deeply about that, but they could use something like the diff algorithm to compare the current message to previously posted messages. So, say the message contains 5 random letters each time, and the total length of the message is 100 characters. Then the algorithm would mark the new message as having .95% similarity to a previous message. This can then be multiplied by the length (.95*100) to give you a 'spam' score of 95. Also, let's assume that the bot account has a total of 5 different messages that it cycles through, and let's say it's already gone through 40 messages. Then there would be 8 messages all with a spam score of 95 giving the new message an overall spam score of 95*8 or 760. This is obviously very high, and would immediately qualify the user for a temporary speaking shadow ban. (They can type in messages and they'll see them, but no one else will. Great way to stop advertisers.)
I'm not sure what the threshold should be, since typing hi 100 times would only yield a spam score of 200, so it could perhaps be (length of the message + 8 for a spam score of 1000, or some other algorithm). Again, the only problem I foresee with this solution is trading, since it obviously requires very repetitive typing, yet shouldn't necessarily be marked as spam. Just mentioning the item you're selling would eventually be marked as spam, since the item names would be constant no matter what else you typed. So yeah, not sure.