boda-handler
v2.0.0
Published
π Advanced Discord Bot Handler Library with Beautiful Console Interface
Maintainers
Readme
π Boda Handler v2.0.0
β¨ Features
- π¨ Beautiful Console Interface - Stunning visual feedback with colors, animations, and tables
- π Multiple Themes - Choose from Default, Neon, or Dark themes
- β‘ Lightning Fast - Optimized performance with async/await throughout
- π§ Interactive CLI - Complete command-line interface for easy management
- π Real-time Statistics - Monitor your bot's performance and usage
- π― Smart Error Handling - Comprehensive error tracking and reporting
- π Auto-reload - Automatic command and event reloading
- π± Slash Commands - Full support for Discord's slash commands
- π‘οΈ Type Safety - Built with modern JavaScript standards
- π Easy Setup - Get started in seconds with our interactive wizard
π¬ Demo
# Initialize with beautiful animations
npx boda-handler init
# Interactive setup wizard
npx boda-handler setup
# Create components instantly
npx boda-handler create command ping
npx boda-handler create slash userinfo
npx boda-handler create event guildMemberAddπ¦ Installation
npm install boda-handlerπ Quick Start
Method 1: Using CLI (Recommended)
# Interactive setup with beautiful interface
npx boda-handler setup
# Or quick initialization
npx boda-handler init --theme neonMethod 2: Programmatic Setup
const BodaHandler = require('boda-handler');
const handler = new BodaHandler({
theme: 'neon', // 'default', 'neon', 'dark'
animation: true, // Enable beautiful animations
showStats: true, // Display performance statistics
silent: false // Show all output
});
await handler.init();π¨ Themes
π Neon Theme (Default)
Vibrant colors with electric blue and hot pink accents
π΅ Default Theme
Classic blue and green color scheme
π Dark Theme
Elegant monochrome with bright accents
π οΈ CLI Commands
| Command | Description | Options |
|---------|-------------|---------|
| init | Initialize new bot project | --theme, --silent, --no-animation |
| setup | Interactive setup wizard | None |
| create <type> <name> | Create command/event/slash | --category, --description |
| info | Show handler information | None |
Examples:
# Create a moderation command
npx boda-handler create command ban --category "Moderation" --description "Ban a user"
# Create a welcome event
npx boda-handler create event guildMemberAdd --description "Welcome new members"
# Create a slash command
npx boda-handler create slash ping --description "Check bot latency"π Project Structure
your-bot/
βββ π Handler/
β βββ Commands.js # Command loader with beautiful output
β βββ Events.js # Event loader with status tracking
β βββ SlashCommand.js # Slash command handler
βββ π Commands/
β βββ ping.js # Example command with rich embed
βββ π Events/
β βββ ready.js # Bot ready event with stats
β βββ messageCreate.js # Message handler
β βββ interactionCreate.js # Interaction handler
βββ π SlashCommand/
β βββ serverinfo.js # Example slash command
βββ π Config/
β βββ config.js # Bot configuration
βββ π .env # Environment variables
βββ π index.js # Main bot fileπ§ Configuration
Environment Variables (.env)
# Discord Bot Configuration
TOKEN=your_bot_token_here
PREFIX=-
OWNER_ID=your_user_id_here
# Handler Configuration
THEME=neon
SHOW_STATS=true
ANIMATION=trueConfig File (Config/config.js)
module.exports = {
bot: {
prefix: process.env.PREFIX || '-',
token: process.env.TOKEN,
ownerID: process.env.OWNER_ID
},
handler: {
theme: 'neon',
showStats: true,
animation: true,
silent: false
},
// ... more configuration options
};π Creating Commands
Regular Commands
module.exports = {
name: 'ping',
description: 'Check bot latency',
category: 'Utility',
usage: 'ping',
cooldown: 3000,
run: async (client, message, args) => {
const embed = {
color: 0x00ff00,
title: 'π Pong!',
fields: [
{
name: 'π‘ WebSocket Ping',
value: `${client.ws.ping}ms`,
inline: true
}
]
};
message.reply({ embeds: [embed] });
}
};Slash Commands
module.exports = {
name: 'serverinfo',
description: 'Get server information',
options: [
{
name: 'detailed',
description: 'Show detailed information',
type: 5,
required: false
}
],
run: async (client, interaction) => {
// Your slash command code
await interaction.reply({ content: 'Server info!' });
}
};π Events
const chalk = require('chalk');
module.exports = async (client, member) => {
console.log(chalk.green(`β
New member joined: ${member.user.tag}`));
// Your event code here
};π Statistics & Monitoring
The handler automatically tracks:
- β±οΈ Setup time and performance
- π Commands loaded and executed
- π Events registered and triggered
- β Errors and warnings
- π Real-time bot statistics
π Advanced Features
Custom Themes
const handler = new BodaHandler({
theme: 'custom',
customTheme: {
primary: chalk.hex('#your-color'),
secondary: chalk.hex('#your-color'),
// ... more colors
}
});Performance Monitoring
const stats = handler.getStats();
console.log('Commands loaded:', stats.commandsLoaded);
console.log('Setup time:', stats.setupTime);Error Tracking
All errors are automatically logged with beautiful formatting and context information.
π‘οΈ Error Handling
The handler includes comprehensive error handling:
- Command execution errors
- Event listener errors
- File loading errors
- API communication errors
All errors are displayed with beautiful formatting and helpful context.
π Pro Tips
- Use Environment Variables - Keep your token secure in
.env - Organize Commands - Use categories to organize your commands
- Custom Themes - Create your own theme for unique branding
- Monitor Performance - Enable statistics to track bot performance
- Interactive Setup - Use
npx boda-handler setupfor best experience
π€ Contributing
We welcome contributions! Please feel free to submit a Pull Request.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π¨βπ» Author
Boda - Creator and maintainer
π Support
If you find this handler useful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting new features
- π’ Sharing with others
