development mode

This commit is contained in:
Erik 2022-05-11 21:49:50 +03:00
parent 187727fd90
commit 55ba970bb4
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 14 additions and 0 deletions

View File

@ -5,6 +5,7 @@
"132620781791346688", "132620781791346688",
"132777808362471424" "132777808362471424"
], ],
"developmentMode": true,
"clientOptions": { "clientOptions": {
"commentedOut": ["GUILD_PRESENCES","REACTION","MESSAGE","USER"], "commentedOut": ["GUILD_PRESENCES","REACTION","MESSAGE","USER"],
"partials": [ "partials": [

View File

@ -326,6 +326,14 @@ class DiscordClient extends Client {
return this.moderationManager; return this.moderationManager;
} }
get developers() {
return this._options.discord.developers;
}
get developmentMode() {
return this._options.discord.developmentMode;
}
} }
// module.exports = DiscordClient; // module.exports = DiscordClient;

View File

@ -129,6 +129,11 @@ class CommandHandler extends Observer {
let response = null; let response = null;
const now = Date.now(); const now = Date.now();
if (this.client.developmentMode && !this.client.developers.includes(invoker.user.id)) return invoker.reply({
content: 'Bot is in development mode currently and is online for stability testing.\nIt\'ll be ready for public use soon!',
ephemeral: true
});
try { try {
this.logger.info(`${invoker.user.tag} (${invoker.user.id}) is executing ${invoker.command.name} in ${invoker.guild?.name || 'dms'}`); this.logger.info(`${invoker.user.tag} (${invoker.user.id}) is executing ${invoker.command.name} in ${invoker.guild?.name || 'dms'}`);
response = await invoker.command.execute(invoker, options); response = await invoker.command.execute(invoker, options);