forked from Galactic/galactic-bot
bugfixes
This commit is contained in:
parent
ea676845dc
commit
2af1622892
@ -519,7 +519,7 @@ module.exports = class AutoModeration extends Observer {
|
||||
filterResult.filter = 'link';
|
||||
|
||||
if (!silent && perms?.has('SendMessages')) {
|
||||
const res = await this.client.rateLimiter.limitSend(msg.channel, wrapper.format('L_FILTER_DELETE', { user: author.id }), undefined, 'linkFilter');
|
||||
const res = await this.client.rateLimiter.limitSend(channel, wrapper.format('L_FILTER_DELETE', { user: author.id }), undefined, 'linkFilter');
|
||||
//const res = await msg.formattedRespond(`L_FILTER_DELETE`, { params: { user: author.id } });
|
||||
//if (res) res.delete({ timeout: 10000 });
|
||||
setTimeout(() => {
|
||||
|
@ -597,7 +597,7 @@ class GuildLogger extends Observer {
|
||||
if (img.height && img.width) embed.image = { url: img.url };
|
||||
}
|
||||
|
||||
await hook.send({ embeds: [embed] }).catch(this.logger.error);
|
||||
await hook.send({ embeds: [embed] }).catch(this.logger.error.bind(this.logger));
|
||||
|
||||
} else {
|
||||
|
||||
@ -677,6 +677,7 @@ class GuildLogger extends Observer {
|
||||
|
||||
await hook.send({ embeds: [embed] }).catch((err) => {
|
||||
this.logger.error('Error in message edit:\n' + err.stack + `\n${inspect(embed)}`);
|
||||
if (err.code === 10015) wrapper.updateWebhook('messages');
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -92,6 +92,9 @@ class MessageLog extends Setting {
|
||||
};
|
||||
|
||||
let hook = await guild.getWebhook(this.name);
|
||||
// Ensure the webhook actually exists
|
||||
hook = await this.client.fetchWebhook(hook.id).catch(() => null);
|
||||
|
||||
if (hook) await hook.edit({ channel });
|
||||
else {
|
||||
hook = await channel.createWebhook({
|
||||
|
Loading…
Reference in New Issue
Block a user