Discord Bot JS
đ¤ A modular Discord bot built with Discord.js v14 and Node.js. Includes slash commands, a guild event logging system, and automated role assignment.
āĻĒāϰāĻŋāĻāĻŋāϤāĻŋ
README.md
āϏā§āĻāĻŋāĻĒāϤā§āϰ
đ¤ discord-bot-tutorial
A modular Discord bot built with Discord.js v14 and Node.js.
⥠Slash commands ¡ đ Guild event logging ¡ đ Automated role assignment
đ§ About
This project is a hands-on Discord bot built to learn discord.js v14 in practice â no boilerplate generators, no all-in-one frameworks, just modular code you can read top to bottom. It's structured the way a small production bot would be: event handlers, slash commands, and a lightweight database are all auto-loaded and organized by category, so adding a new feature usually means dropping in a single file rather than editing a giant index.js.
đ Deploy
Want to try it without setting it up locally? Deploy it in one click as a community template on Bot-Hosting.net:
đ Click here to deploy
⨠Features
- ⥠Slash commands â modular, auto-loaded from
slashcommands/ - đ Autorole â automatic role assignment for users/bots on join, with role-hierarchy and admin-permission safety checks
- đ Guild logging â channel and role create/update/delete, message delete/bulk delete/update
- đĢ Blacklist system â block users from using the bot with reason, evidence, and automatic expiration
- đĩ Music â Lavalink-powered music playback via
moonlink.js - đī¸ Local JSON database â lightweight file-based storage per guild
đĻ Requirements
- đĸ Node.js
22 - đ¤ A Discord bot application (Discord Developer Portal)
đ ī¸ Setup
1. Clone the repository and install dependencies:
git clone https://github.com/choco-latito29/discord-bot-tutorial.git
cd discord-bot-tutorial
npm install
2. Copy the example environment file and fill in your bot token:
cp .env.example .env
TOKEN=your_bot_token_here
3. Run the bot:
npm start -s
đī¸ Project structure
đ Events/ Event listeners (client, guild, interaction, logging)
đ handlers/ Dynamic loaders for events and slash commands
đ slashcommands/ Slash commands, grouped by category
đ database/ Local JSON-based storage
đŦ Support
Need help or found a bug? Check SUPPORT.md or join the support server.
đ For security-related concerns, please follow the process in SECURITY.md instead of opening a public issue.
đ License
MIT â see LICENSE.
āĻā§āĻāĻžāĻŦā§ āĻĄāĻŋāĻĒā§āϞāϝāĻŧ āĻāϰāĻŦā§āύ
- 1 āĻĄāĻŋāĻĒā§āϞāϝāĻŧ āĻĒā§āĻ āĻā§āϞā§āύāĻāĻĒāύāĻžāϰ āĻĄāĻŋāĻĒā§āϞāϝāĻŧāĻŽā§āύā§āĻā§āϰ āύāĻžāĻŽ āĻĻāĻŋāύāĨ¤ āύāĻŋāĻļā§āĻāĻŋāϤ āĻāϰāĻžāϰ āϏāĻŽāϝāĻŧ āϏāĻžāĻāύ āĻāύ āĻāϰāĻŦā§āύāĨ¤
- 2 āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻĒā§āϰāĻŖ āĻāϰā§āύāĻā§āĻŽāĻĒā§āϞā§āĻ āϝā§āϏāĻŦ āĻŽāĻžāύ āĻāĻžāϝāĻŧ, āϏā§āĻā§āϞ⧠āĻāĻĒāύāĻžāϰ āĻĄāĻŋāĻĒā§āϞāϝāĻŧāĻŽā§āύā§āĻā§āϰ āĻāύāĻāĻžāϝāĻŧāϰāύāĻŽā§āύā§āĻ āĻā§āϰāĻŋāϝāĻŧā§āĻŦāϞ āĻšāĻŋāϏā§āĻŦā§ āϏāĻāϰāĻā§āώāĻŋāϤ āĻšāϝāĻŧāĨ¤
- 3 āϰāĻŋāϏā§āϰā§āϏ āĻĻā§āĻā§ āύāĻŋāύāĻāĻāĻŋ āĻāĻĒāύāĻžāϰ āĻĒā§āϞā§āϝāĻžāύā§āϰ āĻļā§āϝāĻŧāĻžāϰā§āĻĄ āĻĒā§āϞ āĻĨā§āĻā§ āύā§āϝāĻŧ, āϤāĻžāϰāĻĒāϰ āĻāĻžāϞ⧠āĻšāϝāĻŧāĨ¤ āĻĒā§āϰāϤāĻŋāĻāĻŋ āĻ ā§āϝāĻžāĻāĻžāĻāύā§āĻ āĻĢā§āϰāĻŋ āĻĻāĻŋāϝāĻŧā§ āĻļā§āϰ⧠āĻāϰā§āĨ¤