diff --git a/structure/client/DiscordClient.js b/structure/client/DiscordClient.js index 7aee72c..6ee552a 100644 --- a/structure/client/DiscordClient.js +++ b/structure/client/DiscordClient.js @@ -46,6 +46,7 @@ class DiscordClient extends Client { this._evals = new Map(); process.on('message', this._handleMessage.bind(this)); + this.on('debug', this.logger.debug.bind(this.logger)); } @@ -88,11 +89,13 @@ class DiscordClient extends Client { } for (const [param, val] of Object.entries(parameters)) { + // eslint-disable-next-line require-unicode-regexp template = template.replace(new RegExp(`{${escapeRegex(param.toLowerCase())}}`, 'gi'), val); } if(code) { try { + // eslint-disable-next-line no-eval template = eval(template); } catch(error) { this.client.logger.error(`Error in locale ${language}:${index} while executing code.\n${error.stack || error}`); diff --git a/structure/client/Resolver.js b/structure/client/Resolver.js index d0295dd..a2dc71e 100644 --- a/structure/client/Resolver.js +++ b/structure/client/Resolver.js @@ -97,7 +97,7 @@ class Resolver { .filter((c) => type === 'any' || c.type === type) .filter(exact ? (c) => c.tags.includes(key) : filterInexactTags(key)) .array(); - + return components || []; } diff --git a/structure/client/components/settings/moderation/MessageLog.js b/structure/client/components/settings/moderation/MessageLog.js index 9f8a3c2..2dec7ff 100644 --- a/structure/client/components/settings/moderation/MessageLog.js +++ b/structure/client/components/settings/moderation/MessageLog.js @@ -49,7 +49,7 @@ class MessageLogsSetting extends Setting { const { guild } = message; const setting = guild._settings[this.index]; - if (['roles', 'role', 'ignoredrole', 'ignoredroles', 'ignorerole', 'ignoreroles'].includes(method)) { + if (['bypass', 'roles', 'role', 'ignoredrole', 'ignoredroles', 'ignorerole', 'ignoreroles'].includes(method)) { if (!args.length) return { msg: message.format('MISSING_ARGS'), @@ -96,7 +96,7 @@ class MessageLogsSetting extends Setting { }; } - } else if (['channels', 'channel', 'ignoredchannels', 'ignoredchannel', 'ignorechannel', 'ignorechannels'].includes(method)) { + } else if (['ignore', 'channels', 'channel', 'ignoredchannels', 'ignoredchannel', 'ignorechannel', 'ignorechannels'].includes(method)) { if (!args.length) return { msg: message.format('MISSING_ARGS'), diff --git a/structure/client/components/settings/moderation/WordFilter.js b/structure/client/components/settings/moderation/WordFilter.js index 7f6f48c..8960b38 100644 --- a/structure/client/components/settings/moderation/WordFilter.js +++ b/structure/client/components/settings/moderation/WordFilter.js @@ -347,12 +347,12 @@ module.exports = class WordFilter extends FilterSetting { }, { name: '》 Fuzzy filter', - value: setting.fuzzy.length ? '||' + setting.fuzzy.join(', ') + '||' : '`N/A`', + value: setting.fuzzy?.length ? '||' + setting.fuzzy.join(', ') + '||' : '`N/A`', inline: true }, { name: '》 Regex filter', - value: setting.regex.length ? '`' + setting.regex.join('`\n`') + '`' : '`N/A`', + value: setting.regex?.length ? '`' + setting.regex.join('`\n`') + '`' : '`N/A`', inline: true }, {