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.
π€ 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.