#Is it possible to edit the default message returned by "preset preconditions"?
1 messages · Page 1 of 1 (latest)
Implement https://www.sapphirejs.dev/docs/Guide/preconditions/reporting-precondition-failure and rather than sending error.message, send your custom one. And identify the precondition with error.identifier.
The thing is, I'd create my own precondition and then set it in the command's <CommandOptions#preconditions so let's say my custom precondition would be called HasPermissions, how would I specify, from the command, which permissions the user needs to my custom precondition so that it fails/succeeds accordingly?
Because unless I'm miss understanding something, preconditions are static in the sense they will check for the same things regardless of the command sent and it would be nice that I could somehow set a context for the preconditions from the commands
Well first of all we have built in preconditions for permission checking but other than that you should implement the same as those built in ones are with containers: https://github.com/sapphiredev/framework/blob/main/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts