mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
refactor(*): use async functions (#6210)
This commit is contained in:
@@ -57,15 +57,14 @@ class ReactionUserManager extends CachedManager {
|
||||
* @param {UserResolvable} [user=this.client.user] The user to remove the reaction of
|
||||
* @returns {Promise<MessageReaction>}
|
||||
*/
|
||||
remove(user = this.client.user) {
|
||||
async remove(user = this.client.user) {
|
||||
const userId = this.client.users.resolveId(user);
|
||||
if (!userId) return Promise.reject(new Error('REACTION_RESOLVE_USER'));
|
||||
if (!userId) throw new Error('REACTION_RESOLVE_USER');
|
||||
const message = this.reaction.message;
|
||||
return this.client.api.channels[message.channel.id].messages[message.id].reactions[this.reaction.emoji.identifier][
|
||||
await 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);
|
||||
].delete();
|
||||
return this.reaction;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user