misc fixes

This commit is contained in:
Erik 2022-07-12 12:49:53 +03:00
parent 73cae5441c
commit c70b41457a
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 5 additions and 5 deletions

View File

@ -438,7 +438,7 @@ class ModerationManager {
continue; continue;
} }
this.logger.debug(`Going to resolve infraction in: ${callBackAt - currentDate} ms`); this.logger.debug(`Going to resolve infraction in: ${Math.floor((callBackAt - currentDate) / 1000)} s`);
this.callbacks.set(infraction.id, { this.callbacks.set(infraction.id, {
timeout: setTimeout(async () => { timeout: setTimeout(async () => {

View File

@ -561,8 +561,8 @@ module.exports = class AutoModeration extends Observer {
if (!match) return; if (!match) return;
const result = await wrapper.checkInvite(match.groups.code); const result = await wrapper.checkInvite(match.groups.code);
const invite = await this.client.fetchInvite(match.groups.code); const invite = await this.client.fetchInvite(match.groups.code).catch(() => null);
if (whitelist.includes(invite.guild.id)) return; if (whitelist.includes(invite?.guild?.id)) return;
if (!result) { // Doesn't resolve to the origin server if (!result) { // Doesn't resolve to the origin server

View File

@ -76,9 +76,9 @@ class CommandHandler extends Observer {
emoji: 'failure', ephemeral: true emoji: 'failure', ephemeral: true
}); });
await invoker.deferReply();
const inhibitors = await this._handleInhibitors(invoker); const inhibitors = await this._handleInhibitors(invoker);
if(inhibitors.length) return this._generateError(invoker, { type: 'inhibitor', ...inhibitors[0] }); if (inhibitors.length) return this._generateError(invoker, { type: 'inhibitor', ...inhibitors[0] });
await invoker.deferReply();
const response = await this._parseInteraction(interaction, command); const response = await this._parseInteraction(interaction, command);
if (await this._parseResponse(invoker, response)) return; if (await this._parseResponse(invoker, response)) return;