Fix error when sending out moderator reply errors

Yo dawg.
cshd
Dragory 2020-10-25 03:40:43 +02:00
parent 620ab79f71
commit fec963715c
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}