Added command blacklist, added ability to toggle command types
This commit is contained in:
parent
1cafef76d7
commit
7fae0c1582
3 changed files with 38 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue