Sunar

config

Configure builders and fine-tune your discord bot's functionality with the flexible "config" mutator in Sunar. Customize settings, adjust parameters, and optimize your bot's behavior seamlessly.

Usage

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

Implementation

Reference

config

PropTypeDefault
config
<TBuilder extends ConfigurableBuilder>(builder: TBuilder, config: TBuilder["config"]) => void
-

CooldownConfig

PropTypeDefault
time
number
-
limit
number
-
scope
CooldownScope
-

Last updated on

On this page

GitHubEdit on Github ↗