Skip to content

mesiyoq965-sudo/discord-js-handler

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Discord.js

๐Ÿค– Discord.js Handler

Production-ready Discord.js v14 bot handler with slash commands, event system, and modular architecture


NPM Version Discord.js Version License Stars

โšก Quick Start โ€ข ๐ŸŽฏ Commands โ€ข โž• Add Commands โ€ข ๐Ÿค Contribute


โœจ Features

  • ๐Ÿ”ฎ Latest Discord.js v14.14.1 - Built with the most recent Discord API features
  • ๐Ÿงฉ Modular Architecture - Clean separation of commands and events
  • โšก Slash Commands Ready - Native support for Discord's slash commands
  • ๐ŸŽ›๏ธ Prefix Commands - Traditional command support for backward compatibility
  • ๐Ÿ›ก๏ธ Production-Ready - Robust error handling and logging
  • ๐Ÿ“ฆ Lightweight - Minimal dependencies with maximum performance
  • ๐Ÿ”ฅ Hot Reloading - Easy command and event development
  • ๐Ÿงฐ Developer-Friendly - Simple API for creating new features

๐Ÿš€ Tech Stack

โšก Quick Start

Prerequisites

  • Node.js 18.0.0 or higher
  • npm 7.0.0 or higher
  • A Discord bot token (Get one here)

Installation

# Clone the repository
git clone https://github.com/IN3PIRE/discord-js-handler.git
cd discord-js-handler

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env with your favorite editor and add your tokens
nano .env

# Deploy slash commands (required)
npm run deploy

# Start the bot
npm start

Environment Variables

Variable Description Required
DISCORD_TOKEN Your bot token from Discord Developer Portal โœ… Yes
CLIENT_ID Your Discord application ID โœ… Yes
GUILD_ID Test guild ID (optional, for guild-specific commands) โŒ No

๐ŸŽฏ Commands

Slash Commands

Command Description
/ping Check bot latency and API response time
/server Display detailed server information
/user Show basic user information
/userinfo Display comprehensive user statistics
/uptime Show how long the bot has been running

Prefix Commands

Command Description
!help Display available commands and usage
!info Show bot information and statistics
!time Display current server time

โž• Adding New Commands

Create Slash Commands

Create a new file in src/slashcommands/:

const { SlashCommandBuilder } = require('discord.js');

module.exports = {
  data: new SlashCommandBuilder()
    .setName('commandname')
    .setDescription('Description of what this command does'),
  
  async execute(interaction) {
    // Your command logic here
    await interaction.reply('Command executed successfully!');
  },
};

Create Prefix Commands

Create a new file in src/prefixcommands/:

module.exports = {
  name: 'commandname',
  description: 'Description of what this command does',
  
  execute(message, args) {
    // Your command logic here
    message.reply('Command executed successfully!');
  },
};

Create Event Handlers

Create a new file in src/events/:

module.exports = {
  name: 'eventName', // Event name from Discord.js
  once: false, // true = execute once, false = execute on every event
  
  execute(...args) {
    // Your event logic here
    console.log('Event triggered:', this.name);
  },
};

๐Ÿ› ๏ธ Development

Available Scripts

# Deploy slash commands globally
npm run deploy

# Start the bot in production
npm start

# Start with auto-restart on file changes (requires nodemon)
npm run dev

# Install dependencies
npm install

Project Structure

discord-js-handler/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ events/           # Event handlers
โ”‚   โ”œโ”€โ”€ prefixcommands/   # Prefix-based commands
โ”‚   โ”œโ”€โ”€ slashcommands/    # Slash commands
โ”‚   โ”œโ”€โ”€ deploy-commands.js # Command deployment script
โ”‚   โ””โ”€โ”€ index.js          # Main bot file
โ”œโ”€โ”€ .env.example        # Environment template
โ”œโ”€โ”€ .gitignore           # Git ignore rules
โ”œโ”€โ”€ package.json         # Dependencies and scripts
โ””โ”€โ”€ README.md            # Documentation

๐Ÿค Contributing

We love your input! We want to make contributing as easy and transparent as possible. Please read our detailed Contributing Guide for the full process.

๐ŸŒŸ Star Requirement

โš ๏ธ IMPORTANT: You must โญ star this repository before your PR can be merged

๐Ÿš€ Quick Contribution Steps

  1. โญ Star the repo (top-right corner) - Required for PR merge
  2. Find an issue: Look for good first issue or help wanted labels
  3. Comment: Say "I would like to work on this" on the issue
  4. Wait for assignment: Don't start until officially assigned
  5. Fork & create branch: git checkout -b feature/amazing-feature
  6. Submit PR: Follow our contribution guidelines

๐Ÿท๏ธ Issue Labels

  • good first issue - Perfect for newcomers
  • help wanted - Extra attention needed
  • bug - Something isn't working
  • enhancement - New feature or improvement
  • documentation - Docs need updating

Why the star requirement?

  • โœจ Shows support for the project
  • ๐Ÿ‘ค Verifies human contributors
  • ๐Ÿซ‚ Makes you part of our community

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Support

If you like this project, please give it a โญ star!


Made with โค๏ธ by the IN3PIRE Team

View our other projects โ€ข Join our Discord

About

Production-ready Discord.js v14 bot handler with slash commands, event system, and modular architecture

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 98.3%
  • Dockerfile 1.7%