Add ability to disable commands
This commit is contained in:
parent
10fe4501b5
commit
4e1c418246
3 changed files with 19 additions and 5 deletions
|
@ -22,6 +22,15 @@ export class Util {
|
|||
message: "Member is not part of message",
|
||||
};
|
||||
|
||||
const disabledCommands = process.env.COMMANDS_DISABLED?.split(',');
|
||||
|
||||
if (disabledCommands?.find(x => x == name)) {
|
||||
return {
|
||||
valid: false,
|
||||
message: "Command is disabled",
|
||||
};
|
||||
}
|
||||
|
||||
const folder = process.env.FOLDERS_COMMANDS;
|
||||
|
||||
if (existsSync(`${process.cwd()}/${folder}/`)) {
|
||||
|
|
Reference in a new issue