diff --git a/docker-compose.yml b/docker-compose.yml index 45732191..d97148c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: bot: build: . @@ -11,6 +9,7 @@ services: - OWNER_ID=$OWNER_ID - THEME_COLOR=$THEME_COLOR - AREA_LIMIT_PER_USER=$AREA_LIMIT_PER_USER + - DISABLE_FUNNY_WORKER_NAMES=$DISABLE_FUNNY_WORKER_NAMES volumes: - ./logs:/app/logs depends_on: diff --git a/example.env b/example.env index 7ecc76d1..4ae604b3 100644 --- a/example.env +++ b/example.env @@ -7,5 +7,6 @@ DATABASE_URI= OWNER_ID= # optional below -THEME_COLOR= -AREA_LIMIT_PER_USER= +THEME_COLOR=#ffffff #(default blurple color) +AREA_LIMIT_PER_USER=#1 #(default 10, does not count for the owner) +DISABLE_FUNNY_WORKER_NAMES=#true #(default false) diff --git a/src/config.ts b/src/config.ts index 8d091f74..d7b14b81 100644 --- a/src/config.ts +++ b/src/config.ts @@ -22,6 +22,7 @@ const config = { themeColor: parseInt(process.env["THEME_COLOR"] ?? "0", 16) || Colors.Blurple, limitAmountOfAreasPerUser: parseInt(process.env["AREA_LIMIT_PER_USER"] ?? "10", 10), + noGeneratedNames: process.env["DISABLE_FUNNY_WORKER_NAMES"] === "true", } as const; if (config.workerTokens.includes(config.clientToken)) throw new Error("You need to supply a separate bot token to be a worker, they cannot work alongside each other."); diff --git a/src/handlers/workers/Worker.ts b/src/handlers/workers/Worker.ts index 4541ef06..2b1c99fe 100644 --- a/src/handlers/workers/Worker.ts +++ b/src/handlers/workers/Worker.ts @@ -3,6 +3,7 @@ import type { Logger } from "winston"; import { Client, IntentsBitField, Options, Partials } from "discord.js"; import { objects, predicates } from "friendly-words"; import { inspect } from "util"; +import config from "../../config"; import { workerLogger } from "../../utils/logger/discord"; import mainLogger from "../../utils/logger/main"; import handleInteractions from "../interactions"; @@ -86,7 +87,7 @@ export default class Worker { handleInteractions(trueClient, this.workerName); handleMentionCommands(trueClient, this.workerName); - if (trueClient.user.username !== this.workerName) { + if (!config.noGeneratedNames && trueClient.user.username !== this.workerName) { void trueClient.user.edit({ username: this.workerName }); this.logger.info(`Renamed worker to match worker name. (${this.workerName})`); }