Add disabled command message reply

This commit is contained in:
Ethan Lane 2021-09-24 18:46:49 +01:00
parent a3230cad20
commit 3392e6f031
Signed by: Vylpes
GPG key ID: EED233CC06D12504
4 changed files with 7 additions and 1 deletions

View file

@ -21,6 +21,7 @@ export class CoreClient extends Client {
if (!process.env.BOT_PREFIX) throw "BOT_PREFIX is not defined in .env";
if (!process.env.FOLDERS_COMMANDS) throw "FOLDERS_COMMANDS is not defined in .env";
if (!process.env.FOLDERS_EVENTS) throw "FOLDERS_EVENTS is not defined in .env";
if (!process.env.COMMANDS_DISABLED_MESSAGE) throw "COMMANDS_DISABLED_MESSAGE is not defined in .env";
super.on("message", this._events.onMessage);
super.on("ready", this._events.onReady);

View file

@ -25,6 +25,8 @@ export class Util {
const disabledCommands = process.env.COMMANDS_DISABLED?.split(',');
if (disabledCommands?.find(x => x == name)) {
message.reply(process.env.COMMANDS_DISABLED_MESSAGE || "This command is disabled.");
return {
valid: false,
message: "Command is disabled",