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.

Node.js Other 𝒞đ’Ŋ𝑜𝒸𝑜-āĻāϰ āϤ⧈āϰāĻŋ
āĻāχ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻĄāĻŋāĻĒā§āϞāϝāĻŧ āĻ•āϰ⧁āύ
āĻ¸ā§āĻ•ā§āϰāĻŋāύāĻļāϟ 1

āĻĒāϰāĻŋāϚāĻŋāϤāĻŋ

README.md

āϏ⧂āϚāĻŋāĻĒāĻ¤ā§āϰ
GitHub-āĻ āϖ⧁āϞ⧁āύ

🤖 discord-bot-tutorial

A modular Discord bot built with Discord.js v14 and Node.js.

⚡ Slash commands · 📋 Guild event logging · 🎭 Automated role assignment

Deploy on Bot-Hosting.net License: MIT discord.js Node.js Lint Validate GitHub stars Last commit Repo size Support Server

🧠 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.

Architecture Style guide

🚀 Deploy

Want to try it without setting it up locally? Deploy it in one click as a community template on Bot-Hosting.net:

Deploy on Bot-Hosting.net Deployments Community Template

👉 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

đŸ› ī¸ Setup

1. Clone the repository and install dependencies:

Bash
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:

Bash
cp .env.example .env
IGNORE
TOKEN=your_bot_token_here

3. Run the bot:

Bash
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. 1 āĻĄāĻŋāĻĒā§āϞāϝāĻŧ āĻĒ⧇āϜ āϖ⧁āϞ⧁āύāφāĻĒāύāĻžāϰ āĻĄāĻŋāĻĒā§āϞāϝāĻŧāĻŽā§‡āĻ¨ā§āĻŸā§‡āϰ āύāĻžāĻŽ āĻĻāĻŋāύāĨ¤ āύāĻŋāĻļā§āϚāĻŋāϤ āĻ•āϰāĻžāϰ āϏāĻŽāϝāĻŧ āϏāĻžāχāύ āχāύ āĻ•āϰāĻŦ⧇āύāĨ¤
  2. 2 āϭ⧇āϰāĻŋāϝāĻŧ⧇āĻŦāϞ āĻĒā§‚āϰāĻŖ āĻ•āϰ⧁āύāĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āϝ⧇āϏāĻŦ āĻŽāĻžāύ āϚāĻžāϝāĻŧ, āϏ⧇āϗ⧁āϞ⧋ āφāĻĒāύāĻžāϰ āĻĄāĻŋāĻĒā§āϞāϝāĻŧāĻŽā§‡āĻ¨ā§āĻŸā§‡āϰ āĻāύāĻ­āĻžāϝāĻŧāϰāύāĻŽā§‡āĻ¨ā§āϟ āϭ⧇āϰāĻŋāϝāĻŧ⧇āĻŦāϞ āĻšāĻŋāϏ⧇āĻŦ⧇ āϏāĻ‚āϰāĻ•ā§āώāĻŋāϤ āĻšāϝāĻŧāĨ¤
  3. 3 āϰāĻŋāϏ⧋āĻ°ā§āϏ āĻĻ⧇āϖ⧇ āύāĻŋāύāĻāϟāĻŋ āφāĻĒāύāĻžāϰ āĻĒā§āĻ˛ā§āϝāĻžāύ⧇āϰ āĻļ⧇āϝāĻŧāĻžāĻ°ā§āĻĄ āĻĒ⧁āϞ āĻĨ⧇āϕ⧇ āύ⧇āϝāĻŧ, āϤāĻžāϰāĻĒāϰ āϚāĻžāϞ⧁ āĻšāϝāĻŧāĨ¤ āĻĒā§āϰāϤāĻŋāϟāĻŋ āĻ…ā§āϝāĻžāĻ•āĻžāωāĻ¨ā§āϟ āĻĢā§āϰāĻŋ āĻĻāĻŋāϝāĻŧ⧇ āĻļ⧁āϰ⧁ āĻ•āϰ⧇āĨ¤

āϰāĻŋāĻĒā§‹āĻ°ā§āϟ āĻ•āϰāϤ⧇ āϞāĻ— āχāύ āĻ•āϰ⧁āύ

āĻ…āĻĒāĻŦā§āϝāĻŦāĻšāĻžāϰ āϠ⧇āĻ•āĻžāϤ⧇ āϰāĻŋāĻĒā§‹āĻ°ā§āϟ āĻ…ā§āϝāĻžāĻ•āĻžāωāĻ¨ā§āĻŸā§‡āϰ āϏāĻžāĻĨ⧇ āϝ⧁āĻ•ā§āϤ āĻĨāĻžāϕ⧇āĨ¤

āϞāĻ— āχāύ