Protector
Protectors in Sunar act as middleware, allowing you to intercept and control the flow of commands and interactions within your Discord bot. They provide a flexible way to enforce permissions, validate inputs, or perform pre-processing before executing commands.
Usage
import { Protector, execute } from 'sunar';
const protector = new Protector({
commands: ['slash'],
});
execute(protector, (arg) => {
// handle execution
});
export { protector };Implementation
Implementing protectors
Protectors in Sunar act as middleware, allowing you to intercept and control the flow of commands and interactions within your Discord bot.
Reference
ProtectorOptions
Prop
Type
How is this guide?
Last updated on
Modal
Modals are popup forms that can collect detailed user input. They are particularly useful for complex interactions that require multiple fields or steps.
SelectMenu
Select menus allow users to choose from a list of options. They are useful for forms, surveys, or any scenario where the user needs to make a selection from multiple choices.