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
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
Implementing cooldowns
Learn how to effectively manage command usage by implementing cooldowns to prevent spam and control interaction frequency.
Dynamic registration
Explore dynamic command registration methods tailored for specific guilds or IDs, enabling flexible bot customization and interaction management.
Reference
config
Prop
Type
CooldownConfig
Prop
Type
How is this guide?
Last updated on
Slash
Slash commands are one of the primary ways users interact with bots. They provide a structured way for users to issue commands directly within the chat interface.
execute
Whether managing slash commands, context menus, or other interactive components, "execute" empowers you to define and execute custom logic effortlessly, enhancing user engagement and bot functionality.