Question

https://www.sapphirejs.dev/docs/Guide/preconditions/reporting-precondition-failure Using this, how can it know if the preconditions error comes from the cooldown precondition
Sapphire Framework
Reporting precondition failure | Sapphire
When a precondition fails, it's usually important for the user to know why. For example, if they hit a cooldown or lack
3 Replies
Ben
Ben•2y ago
You can check the identifier property on the UserError thats passed into the listener. If it is Identifiers.PreconditionCooldown, it came from the cooldown precondition
-Carlos👑
-Carlos👑OP•2y ago
how can I get the time where the command will be available again
Ben
Ben•2y ago
In error.context.remaining

Did you find this page helpful?