mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
fix(MessageReaction): fetchUsers inconsistency
Unlike TextChannel#fetchMessages, this method returned the cache rather than the fetched items, so in interests of consistency, this does as well now closes #2574
This commit is contained in:
@@ -81,12 +81,14 @@ class MessageReaction {
|
|||||||
const message = this.message;
|
const message = this.message;
|
||||||
return message.client.rest.methods.getMessageReactionUsers(
|
return message.client.rest.methods.getMessageReactionUsers(
|
||||||
message, this.emoji.identifier, { after, before, limit }
|
message, this.emoji.identifier, { after, before, limit }
|
||||||
).then(users => {
|
).then(data => {
|
||||||
for (const rawUser of users) {
|
const users = new Collection();
|
||||||
|
for (const rawUser of data) {
|
||||||
const user = this.message.client.dataManager.newUser(rawUser);
|
const user = this.message.client.dataManager.newUser(rawUser);
|
||||||
this.users.set(user.id, user);
|
this.users.set(user.id, user);
|
||||||
|
users.set(user.id, user);
|
||||||
}
|
}
|
||||||
return this.users;
|
return users;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user