2026-01-27 15:20:26 +01:00
2026-01-27 15:05:04 +01:00
2026-01-27 15:05:04 +01:00
2026-01-27 15:05:04 +01:00
2026-01-27 14:33:32 +01:00
2026-01-26 13:54:20 +01:00
2026-01-27 15:05:04 +01:00
2025-01-30 20:15:50 +01:00

Discord Bot

Dashboard setup

This repository includes a lightweight dashboard for configuring permissions and warnings without editing JSON. The dashboard uses Discord OAuth2 and the existing MongoDB collections.

Environment variables

Copy .env.example and fill in the values:

cp .env.example .env

Required backend variables:

  • DISCORD_CLIENT_ID
  • DISCORD_CLIENT_SECRET
  • DISCORD_REDIRECT_URI (example: http://localhost:3000/auth/discord/callback)
  • DISCORD_BOT_TOKEN
  • MONGODB_URI
  • SESSION_SECRET
  • DASHBOARD_CLIENT_URL (example: http://localhost:5173)

Frontend variables (Vite):

  • VITE_API_BASE_URL (example: http://localhost:3000)
  • VITE_BOT_INVITE_URL

Make sure the redirect URI is added in the Discord Developer Portal OAuth2 settings.

Running the backend

node dashboardServer.js

The API will run on DASHBOARD_PORT (default 3000).

Running the dashboard frontend

cd dashboard
npm install
npm run dev

The frontend will run on http://localhost:5173 by default.

API health check

curl http://localhost:3000/health

Existing feature notes

Server-Specific Permission Configuration

Moderation commands support per-server permission overrides stored in MongoDB. Each guild can define which users or roles are allowed to run specific commands, plus optional admin overrides that apply to all moderation commands.

Example document stored in the discord.guild_permissions collection:

{
  "guildId": "1234567890",
  "adminUserIds": ["1111111111"],
  "adminRoleIds": ["2222222222"],
  "commandPermissions": {
    "kick": {
      "allowedUserIds": ["3333333333"],
      "allowedRoleIds": ["4444444444"]
    }
  }
}
S
Description
It's a general Discord bot i will use for my servers. Im using the official discordjs tutorial:
Readme 469 KiB
Languages
JavaScript 77.5%
CSS 14.4%
HTML 8.1%