mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(ReactionUserManager): use client property (#4829)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user