From 0a98b5cb49d223dd3f5111dad67874bd632d535a Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 21 Oct 2020 21:29:20 +0300 Subject: [PATCH] Don't remove !edit command if it fails --- src/data/Thread.js | 1 + src/modules/reply.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/Thread.js b/src/data/Thread.js index f952340..386a33f 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -755,6 +755,7 @@ class Thread { } await this._updateThreadMessage(threadMessage.id, { body: newText }); + return true; } /** diff --git a/src/modules/reply.js b/src/modules/reply.js index a26f531..17b5678 100644 --- a/src/modules/reply.js +++ b/src/modules/reply.js @@ -44,8 +44,8 @@ module.exports = ({ bot, knex, config, commands }) => { return; } - await thread.editStaffReply(msg.member, threadMessage, args.text); - msg.delete().catch(utils.noop); + const edited = await thread.editStaffReply(msg.member, threadMessage, args.text); + if (edited) msg.delete().catch(utils.noop); }, { aliases: ["e"] });