diff --git a/src/structure/components/observers/ErrorLog.js b/src/structure/components/observers/ErrorLog.js index 0e78507..e815e5a 100644 --- a/src/structure/components/observers/ErrorLog.js +++ b/src/structure/components/observers/ErrorLog.js @@ -28,13 +28,13 @@ class ErrorLog extends Observer { async logError({ guild, reason, logger, params }) { - const settings = await guild.settings(); - const { errors } = settings; - const { channel: _channel, types } = errors; - if (!_channel) return; + // const settings = await guild.settings(); + // const { errors } = settings; + // const { channel: _channel, types } = errors; + // if (!_channel) return; - const channel = await guild.resolveChannel(_channel); - if (!channel) return; + // const channel = await guild.resolveChannel(_channel); + // if (!channel) return; const embed = { description: guild.format(`LOGGING_ERROR`, { @@ -44,7 +44,8 @@ class ErrorLog extends Observer { color: COLOURS.warning }; - this.client.rateLimiter.limitSend(channel, { embeds: [embed] }, null, 'logError'); + //this.client.rateLimiter.limitSend(channel, { embeds: [embed] }, null, 'logError'); + this.post(guild, embed, 'logError'); } @@ -156,7 +157,7 @@ class ErrorLog extends Observer { if (!_channel) return; const channel = await guild.resolveChannel(_channel); - if (!channel) return; + if (!channel || channel.permissionsFor(guild.me).missing('SendMessages', 'EmbedLinks')) return; this.client.rateLimiter.limitSend(channel, { embeds: [embed] }, null, type); }