fix(ReactionManager): update message if partial (#3789)

* update message after fetching if it is partial

* suggested changes

Co-Authored-By: SpaceEEC <spaceeec@yahoo.com>

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
Sugden
2020-02-16 18:24:12 +00:00
committed by GitHub
parent 21d37ed0cc
commit bc5e2950d0

View File

@@ -73,6 +73,7 @@ class ReactionManager extends BaseManager {
const existing = this.cache.get(id);
if (!this._partial(reactionEmoji)) return existing;
const data = await this.client.api.channels(this.message.channel.id).messages(this.message.id).get();
if (this.message.partial) this.message._patch(data);
if (!data.reactions || !data.reactions.some(r => (r.emoji.id || r.emoji.name) === id)) {
reactionEmoji.reaction._patch({ count: 0 });
this.message.reactions.cache.delete(id);