mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
Moved all error strings to src/errors/messages and a few other things (#1695)
* Added missing error messages As well as `Guild#setRolePosition` and `Guild#setChannelPosition`'s first arg validation And fixed a typo in `Guild#setChannelPosition` `roles` -> `channels` * Reverted collection and Util constructors * Removed leftover messages Should have been in the second commit. * It's a single invalid permission and removed unused flag error * Fix INVALID_TOKEN -> TOKEN_INVALID as of #1703
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Collection = require('../util/Collection');
|
||||
const Emoji = require('./Emoji');
|
||||
const ReactionEmoji = require('./ReactionEmoji');
|
||||
const { Error } = require('../errors');
|
||||
|
||||
/**
|
||||
* Represents a reaction to a message.
|
||||
@@ -62,7 +63,7 @@ class MessageReaction {
|
||||
*/
|
||||
remove(user = this.message.client.user) {
|
||||
const userID = this.message.client.resolver.resolveUserID(user);
|
||||
if (!userID) return Promise.reject(new Error('Couldn\'t resolve the user ID to remove from the reaction.'));
|
||||
if (!userID) return Promise.reject(new Error('REACTION_RESOLVE_USER'));
|
||||
return this.message.client.api.channels[this.message.channel.id].messages[this.message.id]
|
||||
.reactions[this.emoji.identifier][userID === this.message.client.user.id ? '@me' : userID]
|
||||
.delete()
|
||||
|
||||
Reference in New Issue
Block a user