Skip to content

Discord Bot JS

by π’žπ’½π‘œπ’Έπ‘œ Node.js Other

πŸ€– 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 JS screenshot 1
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

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.