forked from Galactic/galactic-bot
bugfix & perm check
This commit is contained in:
parent
783abcee62
commit
08ea03ccbf
@ -28,13 +28,13 @@ class ErrorLog extends Observer {
|
|||||||
|
|
||||||
async logError({ guild, reason, logger, params }) {
|
async logError({ guild, reason, logger, params }) {
|
||||||
|
|
||||||
const settings = await guild.settings();
|
// const settings = await guild.settings();
|
||||||
const { errors } = settings;
|
// const { errors } = settings;
|
||||||
const { channel: _channel, types } = errors;
|
// const { channel: _channel, types } = errors;
|
||||||
if (!_channel) return;
|
// if (!_channel) return;
|
||||||
|
|
||||||
const channel = await guild.resolveChannel(_channel);
|
// const channel = await guild.resolveChannel(_channel);
|
||||||
if (!channel) return;
|
// if (!channel) return;
|
||||||
|
|
||||||
const embed = {
|
const embed = {
|
||||||
description: guild.format(`LOGGING_ERROR`, {
|
description: guild.format(`LOGGING_ERROR`, {
|
||||||
@ -44,7 +44,8 @@ class ErrorLog extends Observer {
|
|||||||
color: COLOURS.warning
|
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;
|
if (!_channel) return;
|
||||||
|
|
||||||
const channel = await guild.resolveChannel(_channel);
|
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);
|
this.client.rateLimiter.limitSend(channel, { embeds: [embed] }, null, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user