* fix error handling in subcommandPermCheck
This edit fixes the error "<subcommandName> not found on command: <commandName>." it was finding the incorrect subcommand from the list vs the command subcommands.
* fix error handling in permCheck
Errors were not being thrown in the correct manner. This edit will filter through the command subcommandgroups and subcommands to validate the listed names in the plugin. Originally, the plugin would only search for the first subcommandgroup or subcommand and try to match to an in the list.
* feat: Create subcommandPermCheck plugin
This plugin was requested to be uploaded for basic sub command permission handling. Only available for slash commands and will fault out for other command types.
* edit: resolve conflicts
Removed deconstructed interaction
Made errors more understandable
Corrected the example to use a parameter as the first object and input correct properties.
---------
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
* chore: Update permCheck.ts
Allows users to check member perms before using specific sub command groups, sub commands, and options!
* edit: permCheck - revert back to a function
Reverted permCheck back to a function to avoid breaking changes.
* edit: permCheck.ts
Remove console logs
* formatting permCheck.ts
* edit: Update permCheck.ts
Fixed overall formatting
simplified ephemeral booleans
No longer destructuring interaction from ctx
fixed in guild from not fully returning controller.stop()
remove `no_guild` function in favor of hard coding
imported type CommandType
* edit: Update permCheck.ts
Remove ALL destructures `({ ctx })` --> `(ctx)`
* edit: Update permCheck.ts
edit response for not being in guild
* edit: permCheck - assigned to object
Remove all breaking changes while maintaining integrity of new features as well as original!
* edit: permCheck - remove un-needed code.
Thanks to Duro for simplifying the code into one function!
---------
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
Noticed a few bugs.
1) Changed invalid import from discord.js. Implicitly had an any type for `onFail`.
```diff
-ReplyMessageOptions
+MessageReplyOptions
```
2) Corrected the improper catching of errors by implementing try/catch blocks. Included more detailed error responses.
3) Default reply for slash with onFail inputted was invalid because it could also be a string.
* feat: Update plugin `disable`
Updates PluginType to work with new typings for sern v2.
Application does not fail to respond when no fail message is defined.
* fix: Resolve changes
Setup the timeout differently and added notes to explain what the functions do.