From 09708482f677452c111a5c559b9c84ab50613b94 Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Mon, 4 Jun 2018 22:26:51 -0500 Subject: [PATCH] fix(ReactionUserStore): fetch inconsistency It should be consistent with MessageStore#fetch now --- src/stores/ReactionUserStore.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stores/ReactionUserStore.js b/src/stores/ReactionUserStore.js index a07a9a093..dace1e94c 100644 --- a/src/stores/ReactionUserStore.js +++ b/src/stores/ReactionUserStore.js @@ -1,3 +1,4 @@ +const Collection = require('../util/Collection'); const DataStore = require('./DataStore'); const { Error } = require('../errors'); @@ -21,14 +22,16 @@ class ReactionUserStore extends DataStore { */ async fetch({ limit = 100, after, before } = {}) { const message = this.reaction.message; - const users = await this.client.api.channels[message.channel.id].messages[message.id] + const data = await this.client.api.channels[message.channel.id].messages[message.id] .reactions[this.reaction.emoji.identifier] .get({ query: { limit, before, after } }); - for (const rawUser of users) { + const users = new Collection(); + for (const rawUser of data) { const user = this.client.users.add(rawUser); this.set(user.id, user); + users.set(user.id, user); } - return this; + return users; } /**