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 แžŠแŸ„แž™ ๐’ž๐’ฝ๐‘œ๐’ธ๐‘œ
Deploy template แž“แŸแŸ‡
แžšแžผแž”แžแžแžขแŸแž€แŸ’แžšแž„แŸ‹ 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.

แžšแž”แŸ€แž” deploy แžœแžถ

  1. 1 แž”แžพแž€แž‘แŸ†แž–แŸแžš deployแžŠแžถแž€แŸ‹แžˆแŸ’แž˜แŸ„แŸ‡ deployment แžšแž”แžŸแŸ‹แžขแŸ’แž“แž€แŸ” แžขแŸ’แž“แž€แž“แžนแž„แž…แžผแž›แž‚แžŽแž“แžธแž–แŸแž›แž”แž‰แŸ’แž‡แžถแž€แŸ‹แŸ”
  2. 2 แž”แŸ†แž–แŸแž‰แžขแžแŸแžšแžšแž”แžŸแŸ‹แžœแžถแžแž˜แŸ’แž›แŸƒแžŠแŸ‚แž› template แžŸแŸ’แž“แžพแžŸแžปแŸ† แžšแž€แŸ’แžŸแžถแž‘แžปแž€แž‡แžถแžขแžแŸแžšแž”แžšแžทแžŸแŸ’แžแžถแž“แž“แŸƒ deployment แžšแž”แžŸแŸ‹แžขแŸ’แž“แž€แŸ”
  3. 3 แž–แžทแž“แžทแžแŸ’แž™แž’แž“แž’แžถแž“แžšแž”แžŸแŸ‹แžขแŸ’แž“แž€แžœแžถแž”แŸ’แžšแžพแž’แž“แž’แžถแž“แž–แžธแž’แž“แž’แžถแž“แžšแžฝแž˜แž“แŸƒ plan แžšแž”แžŸแŸ‹แžขแŸ’แž“แž€ แžšแžฝแž…แž…แžถแž”แŸ‹แž•แŸ’แžแžพแž˜แžŠแŸ†แžŽแžพแžšแž€แžถแžšแŸ” แž‚แŸ’แžšแž”แŸ‹แž‚แžŽแž“แžธแž…แžถแž”แŸ‹แž•แŸ’แžแžพแž˜แžฅแžแž‚แžทแžแžแŸ’แž›แŸƒแŸ”

แž…แžผแž›แžŠแžพแž˜แŸ’แž”แžธแžšแžถแž™แž€แžถแžšแžŽแŸ

แžšแž”แžถแž™แž€แžถแžšแžŽแŸแžแŸ’แžšแžผแžœแž”แžถแž“แž—แŸ’แž‡แžถแž”แŸ‹แž‡แžถแž˜แžฝแž™แž‚แžŽแž“แžธ แžŠแžพแž˜แŸ’แž”แžธแž€แžถแžšแž–แžถแžšแž€แžถแžšแžšแŸ†แž›แŸ„แž—แž”แŸ†แž–แžถแž“แŸ”

แž…แžผแž›