From b4aa944723d747d8d947c661cb584b9d5ade4c91 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Tue, 11 Aug 2020 21:56:25 -0500 Subject: [PATCH] Hotfix client config stuff --- src/events.js | 4 ++-- src/structures/Command.js | 2 +- src/structures/GenericPager.js | 3 ++- src/util.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/events.js b/src/events.js index 83780f4..19f2bf2 100644 --- a/src/events.js +++ b/src/events.js @@ -20,11 +20,11 @@ module.exports = class Events { if (this.client.messageAwaiter.processHalt(message)) return; // Command parsing - const argInterpretor = new ArgumentInterpreter(Util.Prefix.strip(message, this.client, [config.prefix])); + const argInterpretor = new ArgumentInterpreter(Util.Prefix.strip(message, this.client)); const args = argInterpretor.parseAsStrings(); const commandName = args.splice(0, 1)[0]; const command = this.client.cmds.get(commandName, message); - if (!message.content.match(Util.Prefix.regex(this.client, [config.prefix])) || !command) return; + if (!message.content.match(Util.Prefix.regex(this.client)) || !command) return; try { await command._exec(message, { diff --git a/src/structures/Command.js b/src/structures/Command.js index c6ac5a8..f711c84 100644 --- a/src/structures/Command.js +++ b/src/structures/Command.js @@ -17,7 +17,7 @@ class Command { * @private */ _preload() { - if (!this.preload() && this.client.config.debug) + if (!this.preload() && config.debug) this.client.cmds.logger.info('Preloading command', this.name); } diff --git a/src/structures/GenericPager.js b/src/structures/GenericPager.js index f486d88..71cfe5e 100644 --- a/src/structures/GenericPager.js +++ b/src/structures/GenericPager.js @@ -1,5 +1,6 @@ const Paginator = require('./Paginator'); const lodash = require('lodash'); +const config = require('config'); /** * A generic pager that shows a list of items @@ -62,7 +63,7 @@ class GenericPager extends Paginator { description: this.header || undefined, footer: this.footer ? { text: this.footer } : undefined, fields: [] - }, this.embedExtra, { color: this.client.config.embedColor }); + }, this.embedExtra, { color: config.embedColor }); embed.fields.push({ name: '*List Prompt*', diff --git a/src/util.js b/src/util.js index 2ebc874..8205a89 100644 --- a/src/util.js +++ b/src/util.js @@ -104,7 +104,7 @@ Util.Random = { Util.Prefix = { regex(client, prefixes = null) { if (!prefixes) - prefixes = [client.config.prefix]; + prefixes = [config.prefix]; return new RegExp(`^((?:<@!?${client.user.id}>|${ prefixes.map(prefix => Util.Escape.regex(prefix)).join('|')})\\s?)(\\n|.)`, 'i'); }, @@ -149,7 +149,7 @@ Util.CommandPermissions = { emoji: (client, message) => message.channel.type === 1 || message.channel.permissionsOf(client.user.id).has('externalEmojis'), guild: (_, message) => !!message.guildID, - elevated: (client, message) => client.config.elevated.includes(message.author.id), + elevated: (_, message) => config.elevated.includes(message.author.id), curator: (client, message) => { const member = message.guildID ? message.member : client.guilds.get(config.guildID).members.get(message.author.id);