mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
refactor(ReactionUserManager): use client property (#4829)
This commit is contained in:
parent
13d64e6fa6
commit
169d4c3bff
1 changed files with 7 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue