From 0acb27135f76a7785979e39fc4fb2cfd4933e97d Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 19 Jun 2021 21:35:32 +0300 Subject: [PATCH] LOL --- logger/transports/DiscordWebhook.js | 4 +++- structure/Modmail.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/logger/transports/DiscordWebhook.js b/logger/transports/DiscordWebhook.js index 5dbd60d..b83bd22 100644 --- a/logger/transports/DiscordWebhook.js +++ b/logger/transports/DiscordWebhook.js @@ -41,7 +41,9 @@ class DiscordWebhook extends Transport { } }; - this.webhookClient.send('', { embeds: [embed] }); + this.webhookClient.send('', { embeds: [embed] }).catch(() => { + // DO nothing + }); callback(); } diff --git a/structure/Modmail.js b/structure/Modmail.js index f965a9d..31a48e8 100644 --- a/structure/Modmail.js +++ b/structure/Modmail.js @@ -352,7 +352,7 @@ class Modmail { this.client.logger.error(`Error during channel transition:\n${err.stack}`); }); await message.delete().catch(this.client.logger.warn.bind(this.client.logger)); - if (!this.updatedThreads.includes(author.id)) this.updatedThreads.push(author.id); + if (!this.updatedThreads.includes(userId)) this.updatedThreads.push(userId); } @@ -398,7 +398,7 @@ class Modmail { await message.channel.send('Delivered.').catch(this.client.logger.error.bind(this.client.logger)); const channel = await this.loadChannel(targetMember, history).catch(this.client.logger.error.bind(this.client.logger)); history.push({ author: member.id, content, timestamp: Date.now(), isReply: true, anon }); - if (!this.updatedThreads.includes(author.id)) this.updatedThreads.push(author.id); + if (!this.updatedThreads.includes(target.id)) this.updatedThreads.push(target.id); await channel.send({ embed }).catch(this.client.logger.error.bind(this.client.logger)); await channel.edit({ parentID: this.readMail.id }).catch(this.client.logger.error.bind(this.client.logger));