Skip to content

Zeikrom251/Discord-Bot-Handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot Handler

This project provides a basic structure for a Discord bot build with Discord.js

✨ Features

  • Command Handling : Load and handle commands dynamically.
  • Database Integration : Connect a database with reconnection logic.
  • Slash Commands : Register and handle custom slash commands.
  • Interaction Handlers : Handle interactions like buttons, select menus, and modals.
  • Error Handling : Built in error handler.

📁 Project Structure

/project
│
├── /commands           # Put your commands in this folder
│   ├── ping.js
│
├── /events             # Add other events like "guildMemberAdd" or "messageCreate"
│   ├── ready.js
│   ├── interactionCreate.js
│
├── /loader
│   ├── loadCommands.js
│   ├── loadDataBase.js
│   ├── loadEvents.js
│   ├── loadSlashCommand.js
│
├── config.json         # Edit the config file as you wish
├── main.js
├── package.json        # Dependencies are here
└── README.md

🚀 Installation

1. Clone the repository

You can start by cloning the repository to your local machine :

git clone https://github.com/Zeikrom251/Discord-Bot-Handler.git

2. Install Dependencies

Navigate to the project folder and install the required dependencies :

cd Discord-Bot-Handler
npm install

3. Configuration

Edit the config.json file with your bot's information, including :

  • token : Your Discord bot token (Here)
  • colors : Customize the color scheme for your bot mainServerColor
  • Channels : Define channel IDs for logs and error logs.
  • Optionnal :
    • db : Configure your database connection settings (host, user, password, database name).

Example config.json :

{
  "token": "YOUR_BOT_TOKEN",
  "colors": {
    "mainServerColor": "#FF5733",
    "default": "#1e2124",
    "error": "#ff0000",
    "success": "#1fff00",
    "warning": "#fff300"
  },
  "emotes": {
    "error": "",
    "success": "",
    "warning": ":warning:"
  },
  "channels": {
    "logs": "YOUR_CHANNEL_ID",
    "errorLogs": "YOUR_CHANNEL_ID"
  },
  "db": {
    "dataBaseHost": "localhost",
    "dataBaseUser": "root",
    "dataBasePassword": "YOUR_PASSWORD",
    "dataBaseName": "YOUR_DATABASE_NAME"
  }
}

4. Running the Bot

Start the bot by running :

npm start

the bot will log in and be ready to accept commands.


🤝 Contributing

Feel free to fork this repository, create an issue, or submit a pull request if you find any bugs or want to add new features.


📄 License

This project is licensed under the MIT License.

About

A quick handler for your Discord Bot. Start creating !

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published