misc fixes

This commit is contained in:
Erik 2022-06-13 12:42:43 +03:00
parent 28458ffa2a
commit 02dd19b0af
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 4 additions and 3 deletions

View File

@ -433,6 +433,7 @@ class ModerationManager {
};
for (const infraction of infractions) {
if(!infraction) throw new Error('Undefined infraction');
const callBackAt = infraction.timestamp + infraction.duration;
if (callBackAt - currentDate <= 0) {
await resolve(infraction);

View File

@ -27,8 +27,8 @@ class EvalCommand extends Command {
let response = null;
try {
let evaled = eval(params); //eslint-disable-line no-eval
if (evaled instanceof Promise) await evaled;
let evaled = await eval(params); //eslint-disable-line no-eval
// if (evaled instanceof Promise) await evaled;
if (typeof evaled !== 'string') evaled = inspect(evaled);
evaled = evaled
.replace(new RegExp(this.client.token, 'gu'), '<redacted>')

View File

@ -106,7 +106,7 @@ module.exports = class AutoModeration extends Observer {
const { guild, author, channel, guildWrapper: wrapper } = message;
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 { wordfilter: setting } = settings;
const { bypass, ignore, enabled, silent, explicit, fuzzy, regex, whitelist, actions } = setting;