From 45dd34c7b8b503142bd75c3bf91cf0c44d5475d2 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 27 Dec 2019 22:28:52 +0100 Subject: [PATCH] Load partial --- event/listeners/message.js | 9 ++++++++- event/listeners/messageReactionAdd.js | 7 +++++++ event/listeners/messageReactionRemove.js | 10 ++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 2f3e20a..7cb7521 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -14,7 +14,14 @@ class messageListener extends Listener { }); } - async exec(message) { + async exec(message) { + if (message.partial) { + await message.fetch() + .catch(() => { + return; + }); + } + if (message.author.bot) return; diff --git a/event/listeners/messageReactionAdd.js b/event/listeners/messageReactionAdd.js index b623e2f..4fbc7a9 100644 --- a/event/listeners/messageReactionAdd.js +++ b/event/listeners/messageReactionAdd.js @@ -12,6 +12,13 @@ class MessageReactionAddListener extends Listener { } async exec(reaction) { + if (reaction.message.partial) { + await reaction.message.fetch() + .catch(() => { + return; + }); + } + let starboardChannel, shameboardChannel; let reactionCount = reaction.count; diff --git a/event/listeners/messageReactionRemove.js b/event/listeners/messageReactionRemove.js index 2803597..2bb01e4 100644 --- a/event/listeners/messageReactionRemove.js +++ b/event/listeners/messageReactionRemove.js @@ -10,8 +10,14 @@ class messageReactionRemoveListener extends Listener { }); } - async exec(reaction, user) { - if (reaction.message.author == user) return; + async exec(reaction) { + if (reaction.message.partial) { + await reaction.message.fetch() + .catch(() => { + return; + }); + } + let starboardChannel, shameboardChannel; // Starboard