No description
  • TypeScript 98.6%
  • Dockerfile 1.4%
Find a file
2026-07-02 21:25:24 +01:00
src group commands and docker 2026-07-02 21:25:24 +01:00
.dockerignore group commands and docker 2026-07-02 21:25:24 +01:00
.env.example group commands and docker 2026-07-02 21:25:24 +01:00
.gitignore group commands and docker 2026-07-02 21:25:24 +01:00
Dockerfile group commands and docker 2026-07-02 21:25:24 +01:00
package.json group commands and docker 2026-07-02 21:25:24 +01:00
pnpm-lock.yaml it works! 2026-07-02 14:01:17 +01:00
README.md group commands and docker 2026-07-02 21:25:24 +01:00
tsconfig.json it works! 2026-07-02 14:01:17 +01:00

role-master

TypeScript Discord bot for fake role pings and role analysis. It runs on Node's built-in TypeScript stripping through Discord Gateway, so it does not need ngrok or a public HTTP endpoint.

Groups are stored in SQLite and scoped per server.

Setup

pnpm install
cp .env.example .env

Requires Node 24 or newer.

Fill in .env:

DISCORD_BOT_TOKEN=...
DISCORD_APPLICATION_ID=...
DB_FILE=data/role-master.sqlite

Discord setup

  1. Create an app in the Discord Developer Portal.
  2. Bot tab: create/reset token and put it in DISCORD_BOT_TOKEN.
  3. General Information: copy Application ID into DISCORD_APPLICATION_ID.
  4. Bot tab: enable Server Members Intent for /analyze-roles.
  5. OAuth2 URL Generator:
    • scopes: bot, applications.commands
    • bot permissions: View Channels, Send Messages, Read Message History
  6. Open the generated invite URL and add it to any servers you want.

Run

pnpm run dev

The bot registers global slash commands on startup. Global commands can take a bit to appear across servers.

Docker

docker build -t role-master .
docker run --rm \
  -e DISCORD_BOT_TOKEN=... \
  -e DISCORD_APPLICATION_ID=... \
  -v role-master-data:/data \
  role-master

For Coolify, set the env vars above and persist /data.

Commands

  • /ping group:pato: public message mentioning users from the configured group
  • /group create group:pato
  • /group add group:pato user:@thomas
  • /group remove group:pato user:@thomas
  • /group list
  • /group show group:pato
  • /group delete group:pato
  • /analyze-roles mention-days:30: role member counts plus role mention counts from readable channel history