Sunar

protect

Discover the "protect" mutator in Sunar, designed to enforce permissions and safeguard interactions within your Discord bot. By integrating "protect" into your commands and interactions, you can ensure that only authorized users or roles can access specific functionalities, enhancing security and control over bot operations.

Usage

src/commands/ping.js
import { Slash, execute, protect } from 'sunar';
 
const slash = new Slash({
	name: 'ping',
	description: "Ping the bot to check if it's online.",
});
 
protect(slash, [/* your protectors */]); 
 
execute(slash, (interaction) => {
	interaction.reply('Pong!');
});
 
export { slash };

Implementation

Last updated on

On this page

GitHubEdit on Github ↗