Can I set different requiredUserPermissions for each subcommand?

CCata3/22/2023
Just wondering if this is possible, and how. Thanks
FFavna3/23/2023
Subcommands don't have a precondition system and adding them would mean either completely overhauling both framework and subcommands and making subcommands a core feature, or making a completely separate subcommands precondition store, for the sake of separation of concerns. That all said, don't forget that preconditions are just glorified if checks. You can simply write:
if(!condition) {
throw new UserError(...)
}
if(!condition) {
throw new UserError(...)
}
Or even extract that to a function and just call the function. As the function will throw and that will bubble up you don't even need to if check or anything in the function. Once you have the error use the subcommand specific error events to handle it.

Looking for more? Join the community!