From b60057e1102ce2467369163b597fc16b7580bbb8 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 5 Mar 2020 22:42:16 +0100 Subject: [PATCH] delete message only if it can send message --- event/listeners/message.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 2b3b3c8c..d2dde9f5 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -270,8 +270,10 @@ class messageListener extends Listener { let Attachment = (quote.attachments).array(); if (Attachment[0]) Embed.setImage(Attachment[0].url); - message.delete(); - return message.channel.send(Embed); + return message.channel.send(Embed) + .then(() => { + message.delete(); + }); } }