Skip to content

Commit

Permalink
Update MessageReactionManager.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Aug 24, 2024
1 parent 15f919e commit e0c80fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/managers/MessageReactionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class MessageReactionManager {

/**
* Adds a reaction to a message.
* @param {String} user_id The id of the user who reacted.
* @param {String} userId The id of the user who reacted.
* @param {String} emoji The id or unicode emoji that was reacted with.
* @param {Object} data The raw MESSAGE_REACTION_ADD data.
* @throws {TypeError}
* @public
* @method
*/
_addReaction(user_id, emoji, data) {
if (typeof user_id !== "string")
_addReaction(userId, emoji, data) {
if (typeof userId !== "string")
throw new TypeError("GLUON: User ID must be a string.");

if (typeof emoji !== "string")
Expand All @@ -75,26 +75,26 @@ class MessageReactionManager {
guildId: this.#guild.id,
});

this.#cache[emoji]._addReactor(user_id);
this.#cache[emoji]._addReactor(userId);
}

/**
* Removes a reaction from a message.
* @param {String} user_id The id of the user whose reaction was removed.
* @param {String} userId The id of the user whose reaction was removed.
* @param {String} emoji The id or unicode emoji for which the reaction was removed.
* @throws {TypeError}
* @public
* @method
*/
_removeReaction(user_id, emoji) {
if (typeof user_id !== "string")
_removeReaction(userId, emoji) {
if (typeof userId !== "string")
throw new TypeError("GLUON: User ID must be a string.");

if (typeof emoji !== "string")
throw new TypeError("GLUON: Emoji must be a string.");

if (this.#cache[emoji]) {
this.#cache[emoji]._removeReactor(user_id);
this.#cache[emoji]._removeReactor(userId);

if (this.#cache[emoji].count == 0) delete this.#cache[emoji];
}
Expand Down

0 comments on commit e0c80fc

Please sign in to comment.