misc fixes
This commit is contained in:
parent
28458ffa2a
commit
02dd19b0af
@ -433,6 +433,7 @@ class ModerationManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (const infraction of infractions) {
|
for (const infraction of infractions) {
|
||||||
|
if(!infraction) throw new Error('Undefined infraction');
|
||||||
const callBackAt = infraction.timestamp + infraction.duration;
|
const callBackAt = infraction.timestamp + infraction.duration;
|
||||||
if (callBackAt - currentDate <= 0) {
|
if (callBackAt - currentDate <= 0) {
|
||||||
await resolve(infraction);
|
await resolve(infraction);
|
||||||
|
@ -27,8 +27,8 @@ class EvalCommand extends Command {
|
|||||||
|
|
||||||
let response = null;
|
let response = null;
|
||||||
try {
|
try {
|
||||||
let evaled = eval(params); //eslint-disable-line no-eval
|
let evaled = await eval(params); //eslint-disable-line no-eval
|
||||||
if (evaled instanceof Promise) await evaled;
|
// if (evaled instanceof Promise) await evaled;
|
||||||
if (typeof evaled !== 'string') evaled = inspect(evaled);
|
if (typeof evaled !== 'string') evaled = inspect(evaled);
|
||||||
evaled = evaled
|
evaled = evaled
|
||||||
.replace(new RegExp(this.client.token, 'gu'), '<redacted>')
|
.replace(new RegExp(this.client.token, 'gu'), '<redacted>')
|
||||||
|
@ -106,7 +106,7 @@ module.exports = class AutoModeration extends Observer {
|
|||||||
const { guild, author, channel, guildWrapper: wrapper } = message;
|
const { guild, author, channel, guildWrapper: wrapper } = message;
|
||||||
if (!guild || author.bot) return;
|
if (!guild || author.bot) return;
|
||||||
|
|
||||||
const member = message.member || await guild.members.fetch(author.id).catch();
|
const member = message.member || await guild.members.fetch(author.id).catch(() => null);
|
||||||
const settings = await wrapper.settings();
|
const settings = await wrapper.settings();
|
||||||
const { wordfilter: setting } = settings;
|
const { wordfilter: setting } = settings;
|
||||||
const { bypass, ignore, enabled, silent, explicit, fuzzy, regex, whitelist, actions } = setting;
|
const { bypass, ignore, enabled, silent, explicit, fuzzy, regex, whitelist, actions } = setting;
|
||||||
|
Loading…
Reference in New Issue
Block a user