Right now I am experiencing an issue about preventing repetitive letters / words such as new lines "\n\n\n\n", letters "aaaaaaaa", and words "spam spam spam spam".
Here is an example of what I mean of new line in my chat application:
As you can see, this can fill up a chat application if abused. Since I don't really know where to start, I am not going to include any code, as it is not related to this question. I tried looking at some discord bots (I used to be a discord bot programmer) and look at their anti-spam features, but haven't found anything.
I define spam as something that is repeated around 5 times in a row.