From bbb6e21f5196fd979cd599dae92b526b7986a396 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 27 Dec 2019 22:04:37 +0100 Subject: [PATCH] Delete the message when the board get deleted --- event/listeners/messageReactionRemove.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/event/listeners/messageReactionRemove.js b/event/listeners/messageReactionRemove.js index f94e932a..28035976 100644 --- a/event/listeners/messageReactionRemove.js +++ b/event/listeners/messageReactionRemove.js @@ -28,6 +28,7 @@ class messageReactionRemoveListener extends Listener { if (messageID[reaction.message.id] && reaction.emoji.name == staremote && reaction.count < starcount) { let channel = this.client.channels.get(starboardChannel.starboard); let message = await channel.messages.get(messageID[reaction.message.id]); + delete messageID[reaction.message.id]; message.delete(); } else if (reaction.emoji.name == staremote && reaction.count >= starcount) { return editEmbed('starboard', staremote, messageID[reaction.message.id], this.client); @@ -48,6 +49,7 @@ class messageReactionRemoveListener extends Listener { if (messageID[reaction.message.id] && reaction.emoji.name == shameemote && reaction.count < shamecount) { let channel = this.client.channels.get(shameboardChannel.shameboard); let message = await channel.messages.get(messageID[reaction.message.id]); + delete messageID[reaction.message.id]; message.delete(); } else if (reaction.emoji.name == shameemote && reaction.count >= shamecount) { return editEmbed('shameboard', shameemote, messageID[reaction.message.id], this.client);