mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
Add limit param to reaction.fetchUsers
This commit is contained in:
@@ -116,12 +116,13 @@ class MessageReaction {
|
|||||||
/**
|
/**
|
||||||
* Fetch all the users that gave this reaction. Resolves with a collection of users,
|
* Fetch all the users that gave this reaction. Resolves with a collection of users,
|
||||||
* mapped by their IDs.
|
* mapped by their IDs.
|
||||||
|
* @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100
|
||||||
* @returns {Promise<Collection<string, User>>}
|
* @returns {Promise<Collection<string, User>>}
|
||||||
*/
|
*/
|
||||||
fetchUsers() {
|
fetchUsers(limit = 100) {
|
||||||
const message = this.message;
|
const message = this.message;
|
||||||
return new Promise((resolve, reject) => {
|
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 => {
|
.then(users => {
|
||||||
this.users = new Collection();
|
this.users = new Collection();
|
||||||
for (const rawUser of users) {
|
for (const rawUser of users) {
|
||||||
|
|||||||
Reference in New Issue
Block a user