From fec963715c6b9da95a1b75a943b875711cba3de6 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 25 Oct 2020 03:40:43 +0200 Subject: [PATCH] Fix error when sending out moderator reply errors Yo dawg. --- src/data/Thread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/Thread.js b/src/data/Thread.js index 4d60593..c0f331a 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -259,7 +259,7 @@ class Thread { // Because moderator replies have to be editable, we enforce them to fit within 1 message if (! utils.messageContentIsWithinMaxLength(dmContent) || ! utils.messageContentIsWithinMaxLength(inboxContent)) { - await this._deleteThreadMessage(rawThreadMessage); + await this._deleteThreadMessage(threadMessage.id); await this.postSystemMessage("Reply is too long! Make sure your reply is under 2000 characters total, moderator name in the reply included."); return false; } @@ -269,7 +269,7 @@ class Thread { try { dmMessage = await this._sendDMToUser(dmContent, files); } catch (e) { - await this._deleteThreadMessage(rawThreadMessage); + await this._deleteThreadMessage(threadMessage.id); await this.postSystemMessage(`Error while replying to user: ${e.message}`); return false; }