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.
แแแแ deploy แแถ
- 1 แแพแแแแแแ deployแแถแแแแแแแ deployment แแแแแขแแแแ แขแแแแแนแแ แผแแแแแธแแแแแแแแถแแแ
- 2 แแแแแแขแแแแแแแแแถแแแแแแแแ template แแแแพแแปแ แแแแแถแแปแแแถแขแแแแแแทแแแแถแแแ deployment แแแแแขแแแแ
- 3 แแทแแทแแแแแแแถแแแแแแขแแแแแถแแแแพแแแแถแแแธแแแแถแแแฝแแแ plan แแแแแขแแแ แแฝแ แ แถแแแแแแพแแแแแพแแแถแแ แแแแแแแแแธแ แถแแแแแแพแแฅแแแทแแแแแแ