Add limit param to reaction.fetchUsers

This commit is contained in:
Amish Shah
2016-10-27 21:28:03 +01:00
parent 5dd76069f8
commit b15896e0a4

View File

@@ -116,12 +116,13 @@ class MessageReaction {
/**
* Fetch all the users that gave this reaction. Resolves with a collection of users,
* mapped by their IDs.
* @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100
* @returns {Promise<Collection<string, User>>}
*/
fetchUsers() {
fetchUsers(limit = 100) {
const message = this.message;
return new Promise((resolve, reject) => {
message.client.rest.methods.getMessageReactionUsers(message.channel.id, message.id, this.emoji.identifier)
message.client.rest.methods.getMessageReactionUsers(message.channel.id, message.id, this.emoji.identifier, limit)
.then(users => {
this.users = new Collection();
for (const rawUser of users) {