Sunar

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.

Usage

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

Last updated on

On this page

GitHubEdit on Github ↗