kangarko / ChatControl-Pro

The ultimate chat solution. Prevent spam, ads, swears and even bots on your server. Replaced by ChatControl Red: https://mineacademy.org/chatcontrol-red
Other
65 stars 7 forks source link

Adding possibility of regex input for Limited commands per <seconds> #2365

Closed TheJoshue closed 2 years ago

TheJoshue commented 2 years ago

ok this is not something very big so i hope you'll consider doing it as it's very much needed from settings.yml

  # Anti-spam section for commands.
  Commands:

    # How many seconds the player must wait till their next command? Set to 0 to disable.
    Command_Delay: 0

    # Limit how many messages the player can send within a certain time frame.
    Limit:
      Period: 8 seconds
      # By default they can send up to five messages within a ten seconds period.
      Max_Commands: 5
      Whitelist_Limit:
      - 'test'

Now here is /test allowed to be bypassed and typed more than 5 times in 8 seconds (any amount of execution of this command will be ok)

however, if we want to whitelist that command + any subcommand of it we need to type it in (we can't match ANY like *)

so with this, we then need to type in every each command if there is /test hello and /test there etc

why not adding just above or below Whitelist_Limit something like "Whitelist_Limit_Regex_Expression:"

and then we can do add:

      - '\/(test)\b (.*)'

which will match test * commands and allow them!

thank you for this i hope you'll do it because it's very needed!

kangarko commented 2 years ago

Sorry for a late reply, I kept very busy rewriting our settings: https://github.com/kangarko/Foundation/commits/6.0 because of some issues like reloading messages_x.yml not working, I am unable to take your suggestion at the moment, thanks for your understanding :)

TheJoshue commented 2 years ago

but why can't you just add this just like you have regex support for other sections right next to this one???

  # Apply regex's for Whitelist_Similarity, Whitelist_Time and Parrot's whitelist below for both commands and messages?
  Regex_In_Whitelists: true
kangarko commented 2 years ago

I can consider this to ChatControl Red, not to Pro