Webpack build for branch 11.3-dev: db5bdcd855

This commit is contained in:
Travis CI 2018-01-04 00:11:38 +00:00
parent 79bcdb16f3
commit 41b00555b1
2 changed files with 12 additions and 9 deletions

View file

@ -256,8 +256,8 @@ const Endpoints = exports.Endpoints = {
toString: () => mbase,
reactions: `${mbase}/reactions`,
ack: `${mbase}/ack`,
Reaction: (emoji, limit) => {
const rbase = `${mbase}/reactions/${emoji}${limit ? `?limit=${limit}` : ''}`;
Reaction: emoji => {
const rbase = `${mbase}/reactions/${emoji}`;
return {
toString: () => rbase,
User: userID => `${rbase}/${userID}`,
@ -13263,19 +13263,20 @@ 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
* @param {Object} [options] Options to fetch users
* @param {Snowflake} [options.before] Limit fetching users to those with an id lower than the supplied id
* @param {Snowflake} [options.after] Limit fetching users to those with an id greater than the supplied id
* @returns {Promise<Collection<Snowflake, User>>}
*/
fetchUsers(limit = 100) {
fetchUsers(limit = 100, { after, before } = {}) {
const message = this.message;
return message.client.rest.methods.getMessageReactionUsers(
message, this.emoji.identifier, limit
message, this.emoji.identifier, { after, before, limit }
).then(users => {
this.users = new Collection();
for (const rawUser of users) {
const user = this.message.client.dataManager.newUser(rawUser);
this.users.set(user.id, user);
}
this.count = this.users.size;
return this.users;
});
}
@ -18041,8 +18042,10 @@ class RESTMethods {
.then(() => message);
}
getMessageReactionUsers(message, emoji, limit = 100) {
return this.rest.makeRequest('get', Endpoints.Message(message).Reaction(emoji, limit), true);
getMessageReactionUsers(message, emoji, options) {
const queryString = (querystring.stringify(options).match(/[^=&?]+=[^=&?]+/g) || []).join('&');
return this.rest.makeRequest('get', `${Endpoints.Message(message).Reaction(emoji)}?${queryString}`, true);
}
getApplication(id) {

File diff suppressed because one or more lines are too long