You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace command-costs and command-cooldowns with command filters system #3200
Currently, command-costs and command-cooldowns are separate and behave slightly differently - command-costs only supports EssentialsX's own commands and doesn't support regexes, while command-cooldowns supports external plugins commands but doesn't ensure that the command succeeds before setting the cooldown.
The new filters system could be implemented in a separate config, which is a list of filters that contain the following options:
name (optional): a name for the filter, allowing perms to bypass specific filters (as well as allowing us to track cooldowns in player data; if none is provided then we can auto generate a name)
command (required unless pattern is provided): the name of an EssentialsX command; these filters will ensure that the command succeeds before charging the player or starting the cooldown
pattern (required unless command is provided): a regex to match any plugin's command against; these filters will not check whether the command succeeds
cooldown (optional): the length of time that the player will have to wait until they can use a command matching this filter again, in seconds
cost (optional): the amount that will be deducted from the player's economy balance when they use the command
The use of a command or pattern parameter instead of a map key also avoids a bug with the current command-cooldowns where any regex pattern that includes . fails to parse due to YAML syntax errors.
It would be ideal to also migrate over old cooldowns to the new system (similar to how kits were done).
Reacted by ThiagoROX, ice-fly, MineTheCube and Daniil Zao.
Definitely following this issue. I would love only /tpa and /home to cooldowned but need /warp and /spawn without a cooldown so this looks perfect for this case.
Activity
MineTheCube commentedon Jul 14, 2020
Would definitely love something like that! Lack of permission support per command is what I currently miss from these command cooldowns.
james090500 commentedon Aug 17, 2020
Definitely following this issue. I would love only /tpa and /home to cooldowned but need /warp and /spawn without a cooldown so this looks perfect for this case.