refactor(ReactionUserManager): use client property (#4829)

This commit is contained in:
Jan
2020-09-25 23:46:31 +02:00
committed by GitHub
parent 13d64e6fa6
commit 169d4c3bff

View File

@@ -48,16 +48,16 @@ class ReactionUserManager extends BaseManager {
/**
* Removes a user from this reaction.
* @param {UserResolvable} [user=this.reaction.message.client.user] The user to remove the reaction of
* @param {UserResolvable} [user=this.client.user] The user to remove the reaction of
* @returns {Promise<MessageReaction>}
*/
remove(user = this.reaction.message.client.user) {
const message = this.reaction.message;
const userID = message.client.users.resolveID(user);
remove(user = this.client.user) {
const userID = this.client.users.resolveID(user);
if (!userID) return Promise.reject(new Error('REACTION_RESOLVE_USER'));
return message.client.api.channels[message.channel.id].messages[message.id].reactions[
this.reaction.emoji.identifier
][userID === message.client.user.id ? '@me' : userID]
const message = this.reaction.message;
return this.client.api.channels[message.channel.id].messages[message.id].reactions[this.reaction.emoji.identifier][
userID === this.client.user.id ? '@me' : userID
]
.delete()
.then(() => this.reaction);
}