Skip to content

The Discord bot project made with the npm package of discord.js version 14. It handles prefix/slash commands, events, components, multiple languages and logging. You can create as many commands as you want to shape your Bot as you want.

License

Notifications You must be signed in to change notification settings

Da4ndo/Better-DiscordJS-V14-Bot-Template

Repository files navigation


GitHub Repository Statistics/Info:

Language:

Fork/Download For:

Better DiscordJS V14 Bot Template

The Discord bot project made with the npm package of discord.js version 14. It handles prefix commands, slash commands, events, components, multiple languages and logging. You can create as many commands as you want to shape your Bot as you want. Project made with ❤ by Da4ndo.

You can click on the star (⭐️) button above this repository if you liked this project! Thank you all. 🙏

Discord.js Documentation is linked here.

Note: There are a few basic PrefixCommands/SlashCommands/Events/Components added.

Important Note: While the code has been tested, there may still be issues, especially around permission to execute commands. Keep in mind that the included commands, components, and slash commands are examples and should be customized before deployment.

Changelog

[1.2.0] - 2023-05-6

Changed

  • Updated handlers to load all valid command files in their directory and all its subdirectories, regardless of how deep the subdirectories go
  • Fixed forgetten false reference for configs

Added

  • More basic slash commands (userinfo, serverinfo, avatar)

(More in CHANGELOG.md)

How to setup:

1. Install Required Packages

Run the following command:

npm install

OR

npm install discord.js @discordjs/rest ms dotenv moment mongoose

2. Modifying configs

Set token and client id in .env, and modify settings to your preference in config.json

(Checkout documentation file here.)

Database

The bot can work in two ways, either with a database or not.

Supported database is MongoDB. You can enable the database by setting the database key to true. You need a link/IP address for the bot (e.g.: mongodb://root:<password>@link.mongodb.net/mydb or mongodb://mongo:27017/mydb or mongodb://172.19.0.2/). For local database use docker-compose.yml.

How to start?

Run the following command:

npm run start

OR

docker-compose up

Setup bot as a service in linux (SYSTEMD WAY):

  1. Modify bot.service name to <your_bot_name>.service and fill the missing data in it.

  2. Now you need to put it in the system services folder:

sudo mv <your_bot_name>.service /etc/systemd/system/<your_bot_name>.service
  1. How to start:
sudo systemctl start <your_bot_name>

You can view it's logs using the following command:

journalctl -u <your_bot_name>

or use this command to tail the log:

journalctl -fu <your_bot_name>

How to develop

For more information checkout DOCS.md.

About

The Discord bot project made with the npm package of discord.js version 14. It handles prefix/slash commands, events, components, multiple languages and logging. You can create as many commands as you want to shape your Bot as you want.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published