Code-Society-Lab / grace

The official Code Society Discord bot
GNU General Public License v3.0
19 stars 12 forks source link

Spam Protection #20

Closed ConfusedGoose closed 2 years ago

ConfusedGoose commented 3 years ago

As new text is added to the menu in ::help and other commands they will become larger and people might use this to spam chat as it covers more chat without having to put that many characters. A way to fix this would be to stop the same command being put in twice if it is still open on the same user (make sure its individual as doing it for if any are open could cause it not open when someone else tries to use the command.)

Tervicke commented 3 years ago

how can we implement this though ?

PenguinBoi12 commented 3 years ago

how can we implement this though ?

Good question @Brokenhammer72 . There's a few things to check before I can give you a real concrete way to implement that, but here a general idea of what you have to do in order to implement that.

When a user enteres ::help, we would need to validate that there's no help menu already active for that user (I think this information is already accessible with pretty-help, to check).

Depending on how we can use pretty-help to do it the implementation isn't that complicated. If pretty-help allows us to verify that easily all we have to do is override the help command and validate before opening the menu. If it's not easy, we could simply implement a similar system to monitor if a menu is already active for that user and the the rest is the same.

For now, I can't really give you a more precises idea on how to inplement it correctly. If you give me time to check with pretty-help, I'll give you more info on the exact way to implement it.

I hope it answers you question a least a little bit.

PenguinBoi12 commented 2 years ago

This is not useful anymore. Other spam protection have been configured from other bots and the issue didn't occurred. Plus, pretty-help pagination pretty much prevents those kind of problem.