mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03: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.
|
* 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>}
|
* @returns {Promise<MessageReaction>}
|
||||||
*/
|
*/
|
||||||
remove(user = this.reaction.message.client.user) {
|
remove(user = this.client.user) {
|
||||||
const message = this.reaction.message;
|
const userID = this.client.users.resolveID(user);
|
||||||
const userID = message.client.users.resolveID(user);
|
|
||||||
if (!userID) return Promise.reject(new Error('REACTION_RESOLVE_USER'));
|
if (!userID) return Promise.reject(new Error('REACTION_RESOLVE_USER'));
|
||||||
return message.client.api.channels[message.channel.id].messages[message.id].reactions[
|
const message = this.reaction.message;
|
||||||
this.reaction.emoji.identifier
|
return this.client.api.channels[message.channel.id].messages[message.id].reactions[this.reaction.emoji.identifier][
|
||||||
][userID === message.client.user.id ? '@me' : userID]
|
userID === this.client.user.id ? '@me' : userID
|
||||||
|
]
|
||||||
.delete()
|
.delete()
|
||||||
.then(() => this.reaction);
|
.then(() => this.reaction);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user