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 6bca0d92..3608a4b3 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 bcd40062..6743668a 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 6a789b4f..b2196cc9 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;