feat(settings): support toggling disabled commands and auto-reload bot on save

This commit is contained in:
syntaxbullet
2026-01-08 22:44:48 +01:00
parent c6fd23b5fa
commit 9caa95a0d8
4 changed files with 15 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import { EventLoader } from "@lib/loaders/EventLoader";
export class Client extends DiscordClient {
commands: Collection<string, Command>;
knownCommands: Set<string>;
lastCommandTimestamp: number | null = null;
maintenanceMode: boolean = false;
private commandLoader: CommandLoader;
@@ -16,6 +17,7 @@ export class Client extends DiscordClient {
constructor({ intents }: { intents: number[] }) {
super({ intents });
this.commands = new Collection<string, Command>();
this.knownCommands = new Set<string>();
this.commandLoader = new CommandLoader(this);
this.eventLoader = new EventLoader(this);
}
@@ -77,6 +79,7 @@ export class Client extends DiscordClient {
async loadCommands(reload: boolean = false) {
if (reload) {
this.commands.clear();
this.knownCommands.clear();
console.log("♻️ Reloading commands...");
}