From 9dc82d0da1b155c186ee9d30c47c718b2cc6374f Mon Sep 17 00:00:00 2001 From: Navy Date: Wed, 9 Jun 2021 20:10:30 +0300 Subject: [PATCH] added devOnly mode --- structure/client/DiscordClient.js | 1 + structure/client/components/observers/CommandHandler.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/structure/client/DiscordClient.js b/structure/client/DiscordClient.js index ab858da..0e6d180 100644 --- a/structure/client/DiscordClient.js +++ b/structure/client/DiscordClient.js @@ -38,6 +38,7 @@ class DiscordClient extends Client { this._options = options; this._built = false; + this._devOnly = options.devOnly; //TODO: Default config for users and guilds. this._defaultConfig = {}; diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js index 2d3751c..7edbdaa 100644 --- a/structure/client/components/observers/CommandHandler.js +++ b/structure/client/components/observers/CommandHandler.js @@ -36,7 +36,7 @@ class CommandHandler extends Observer { async handleMessage(message) { - if (!message.author.developer) return; + if (!message.author.developer && this.client._devOnly) return; if(!this.client._built || message.webhookID || message.author.bot