dashboard v1

This commit is contained in:
Char committed 2026-05-16 15:10:27 +01:00
1 parent 57d420a9f4
commit 22c33c0f7a
66 files changed
+6100 -465

No files matched your search

+19 -9
View File
@@ -13,23 +13,33 @@
const fs = require("fs");
const path = require("path");
const yaml = require("js-yaml");
const supportbot = yaml.load(
fs.readFileSync("./Configs/supportbot.yml", "utf8")
);
const configStore = require("./Structures/ConfigStore.js");
const Client = require("./Structures/Client.js");
const client = new Client({
intents: ['Guilds', 'GuildMembers', 'GuildMessages', 'MessageContent']
intents: ["Guilds", "GuildMembers", "GuildMessages", "MessageContent"],
});
const APIServer = require("./API/server.js");
client.start(supportbot.General.Token);
// Start dashboard API immediately — do not wait for Discord clientReady
const api = new APIServer(client);
client.apiServer = api;
client.once('clientReady', () => {
const api = new APIServer(client);
api.start();
if (api.config?.Enabled) {
const port = api.config.Port || 3000;
api.start(port);
console.log(
`[Dashboard] API listening on http://localhost:${port} (bot may still be connecting)`,
);
} else {
console.warn("[Dashboard] API disabled in Configs/api.yml");
}
client.start(configStore.supportbot.General.Token);
client.on("clientReady", () => {
console.log("[Dashboard] Discord bot is ready — full stats and guild tools are available");
});
// SupportBot - New Logging System