Added command blacklist, added ability to toggle command types

This commit is contained in:
Essem 2022-08-22 13:03:27 -05:00
parent 1cafef76d7
commit 7fae0c1582
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
3 changed files with 38 additions and 4 deletions

View file

@ -1,6 +1,10 @@
import { paths, commands, info, sounds, categories, aliases as _aliases } from "./collections.js";
import { log } from "./logger.js";
import { readFileSync } from "fs";
const { blacklist } = JSON.parse(readFileSync(new URL("../config/commands.json", import.meta.url)));
let queryValue = 0;
// load command into memory
@ -14,6 +18,11 @@ export async function load(client, cluster, worker, ipc, command, soundStatus, s
const commandArray = command.split("/");
const commandName = commandArray[commandArray.length - 1].split(".")[0];
if (blacklist.includes(commandName)) {
log("warn", `Skipped loading blacklisted command ${command}...`);
return;
}
props.init();
paths.set(commandName, command);