Add disabled command message reply
This commit is contained in:
parent
a3230cad20
commit
3392e6f031
4 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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",
|
||||
|
|
Reference in a new issue