Hotfix client config stuff

This commit is contained in:
Snazzah 2020-08-11 21:56:25 -05:00
parent a4d6f05765
commit b4aa944723
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E
4 changed files with 7 additions and 6 deletions

View file

@ -20,11 +20,11 @@ module.exports = class Events {
if (this.client.messageAwaiter.processHalt(message)) return; if (this.client.messageAwaiter.processHalt(message)) return;
// Command parsing // 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 args = argInterpretor.parseAsStrings();
const commandName = args.splice(0, 1)[0]; const commandName = args.splice(0, 1)[0];
const command = this.client.cmds.get(commandName, message); 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 { try {
await command._exec(message, { await command._exec(message, {

View file

@ -17,7 +17,7 @@ class Command {
* @private * @private
*/ */
_preload() { _preload() {
if (!this.preload() && this.client.config.debug) if (!this.preload() && config.debug)
this.client.cmds.logger.info('Preloading command', this.name); this.client.cmds.logger.info('Preloading command', this.name);
} }

View file

@ -1,5 +1,6 @@
const Paginator = require('./Paginator'); const Paginator = require('./Paginator');
const lodash = require('lodash'); const lodash = require('lodash');
const config = require('config');
/** /**
* A generic pager that shows a list of items * A generic pager that shows a list of items
@ -62,7 +63,7 @@ class GenericPager extends Paginator {
description: this.header || undefined, description: this.header || undefined,
footer: this.footer ? { text: this.footer } : undefined, footer: this.footer ? { text: this.footer } : undefined,
fields: [] fields: []
}, this.embedExtra, { color: this.client.config.embedColor }); }, this.embedExtra, { color: config.embedColor });
embed.fields.push({ embed.fields.push({
name: '*List Prompt*', name: '*List Prompt*',

View file

@ -104,7 +104,7 @@ Util.Random = {
Util.Prefix = { Util.Prefix = {
regex(client, prefixes = null) { regex(client, prefixes = null) {
if (!prefixes) if (!prefixes)
prefixes = [client.config.prefix]; prefixes = [config.prefix];
return new RegExp(`^((?:<@!?${client.user.id}>|${ return new RegExp(`^((?:<@!?${client.user.id}>|${
prefixes.map(prefix => Util.Escape.regex(prefix)).join('|')})\\s?)(\\n|.)`, 'i'); prefixes.map(prefix => Util.Escape.regex(prefix)).join('|')})\\s?)(\\n|.)`, 'i');
}, },
@ -149,7 +149,7 @@ Util.CommandPermissions = {
emoji: (client, message) => message.channel.type === 1 || emoji: (client, message) => message.channel.type === 1 ||
message.channel.permissionsOf(client.user.id).has('externalEmojis'), message.channel.permissionsOf(client.user.id).has('externalEmojis'),
guild: (_, message) => !!message.guildID, 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) => { curator: (client, message) => {
const member = message.guildID ? message.member : const member = message.guildID ? message.member :
client.guilds.get(config.guildID).members.get(message.author.id); client.guilds.get(config.guildID).members.get(message.author.id);