From 30df50614d3859ab174315d7985d309f46f67291 Mon Sep 17 00:00:00 2001 From: Navy Date: Mon, 21 Jun 2021 17:54:20 +0300 Subject: [PATCH] order of operations fix to channel loading --- structure/ChannelHandler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/structure/ChannelHandler.js b/structure/ChannelHandler.js index d260784..eb23f26 100644 --- a/structure/ChannelHandler.js +++ b/structure/ChannelHandler.js @@ -46,9 +46,9 @@ class ChannelHandler { error: true, msg: `Internal error, this has been logged.` }; - history.push(newEntry); const channel = await this.load(target, history).catch(this.client.logger.error.bind(this.client.logger)); + history.push(newEntry); const sent = await channel.send({ embed }).catch((err) => { this.client.logger.error(`channel.send errored:\n${err.stack}\nContent: "${embed}"`); }); @@ -161,7 +161,8 @@ class ChannelHandler { text: user.id }, author: { - name: user.tag + (entry.anon ? ' (ANONYMOUS REPLY)' : ''), + // eslint-disable-next-line no-nested-ternary + name: user.tag + (entry.anon ? ' (ANON)' : entry.isReply ? ' (STAFF)' : ''), // eslint-disable-next-line camelcase icon_url: user.displayAvatarURL({ dynamic: true }) },