From 4529b6a10abc9400fc7f2af1f5f9c1a71612c658 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 17 Jun 2020 15:29:00 +0200 Subject: [PATCH] better handle partial messages --- event/listeners/message.js | 6 ++++-- event/listeners/messageReactionAdd.js | 6 ++++-- event/listeners/messageReactionRemove.js | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 6bca0d9..3608a4b 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -27,9 +27,11 @@ class messageListener extends Listener { if (message.partial) { await message.fetch() - .catch(() => { - return; + .catch(err => { + return console.error(err); }); + } else { + return; } if (message.author.bot) return; diff --git a/event/listeners/messageReactionAdd.js b/event/listeners/messageReactionAdd.js index bcd4006..6743668 100644 --- a/event/listeners/messageReactionAdd.js +++ b/event/listeners/messageReactionAdd.js @@ -14,9 +14,11 @@ class MessageReactionAddListener extends Listener { async exec(reaction) { if (reaction.message.partial) { await reaction.message.fetch() - .catch(() => { - return; + .catch(err => { + return console.error(err); }); + } else { + return; } let starboardChannel, shameboardChannel; diff --git a/event/listeners/messageReactionRemove.js b/event/listeners/messageReactionRemove.js index 6a789b4..b2196cc 100644 --- a/event/listeners/messageReactionRemove.js +++ b/event/listeners/messageReactionRemove.js @@ -13,9 +13,11 @@ class messageReactionRemoveListener extends Listener { async exec(reaction) { if (reaction.message.partial) { await reaction.message.fetch() - .catch(() => { - return; + .catch(err => { + return console.error(err); }); + } else { + return; } let starboardChannel, shameboardChannel;