refactor: initial moves

This commit is contained in:
syntaxbullet
2026-01-08 16:09:26 +01:00
parent 53a2f1ff0c
commit 88b266f81b
164 changed files with 529 additions and 280 deletions

19
bot/lib/configManager.ts Normal file
View File

@@ -0,0 +1,19 @@
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
const configPath = join(process.cwd(), 'config', 'config.json');
export const configManager = {
toggleCommand: (commandName: string, enabled: boolean) => {
const raw = readFileSync(configPath, 'utf-8');
const data = JSON.parse(raw);
if (!data.commands) {
data.commands = {};
}
data.commands[commandName] = enabled;
writeFileSync(configPath, JSON.stringify(data, null, 4));
}
};