Make OverpoweredDiscord Bots.

Sunar emerges as a finely-tuned discord.js framework, meticulously engineered to prioritize ease of use and efficiency.

Build your bot at
the speed of thought.

Easy-to-Use

Offers a simple and readable API, making Discord bot development straightforward for all users.

Fully Typed

Provides robust type definitions, ensuring developers in JavaScript and TypeScript enjoy a seamless experience.

Lightweight

Prioritizes efficiency and performance while delivering essential Discord bot functionalities.

Fast

Supports essential features like slash commands, context menu commands, and more for dynamic bot interactions.

Open Source

Sunar is open-source, allowing community contributions and customization to meet diverse bot development needs.

Structured Code

Encourages clean and organized project architecture for easier maintenance and scalability.

Application Commands

Slash Commands

Slash commands provide a structured and user-friendly way for users to interact with bots on Discord.

import { Slash, execute } from 'sunar';
 
const slash = new Slash({
    name: 'ping',
    description: 'Ping command',
});
 
execute(slash, (interaction) => {
	interaction.reply({ content: 'Pong!' });
});
 
export { slash };

Context Menus

Context menu commands let users interact with bots via right-click options for quick access to functions.

import { ContextMenu, execute } from 'sunar';
 
const contextMenu = new ContextMenu({
	name: 'Ping',
	type: 2,
});
 
execute(contextMenu, (interaction) => {
	interaction.reply({ content: 'Pong!' });
});
 
export { contextMenu };

Signals

Signals allow you to handle specific events or actions within your bot, enabling customized and responsive behavior.

import { Signal, execute } from 'sunar';
 
const signal = new Signal('ready', { once: true });
 
execute(signal, () => {
	console.log('Logged in!');
});
 
export { signal };

Components

Buttons

Buttons provide interactive elements that users can click to trigger specific actions within your bot.

import { Button, execute } from 'sunar';
 
const button = new Button({ id: 'my-button' });
 
execute(button, (interaction) => {
	interaction.reply({ content: 'Pong!' });
});
 
export { button };

Modals

Modals are popup forms that collect detailed user input, ideal for complex interactions requiring multiple fields.

import { Modal, execute } from 'sunar';
 
const modal = new Modal({ id: 'my-modal' });
 
execute(modal, (interaction) => {
	interaction.reply({ content: 'Pong!' });
});
 
export { modal };

Select Menus

Select menus allow users to choose from a list of options, perfect for forms and surveys requiring multiple choices.

import { SelectMenu, execute } from 'sunar';
 
const selectMenu = new SelectMenu({ id: 'my-select-menu', type: 3 });
 
execute(selectMenu, (interaction) => {
	interaction.reply({ content: 'Pong!' });
});
 
export { selectMenu };

Start creating your bot now.