mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-01 16:40:07 +00:00
Which was causing issues when resolving their identifier and MessageRection#id was also stated as nullable Snowflake, which a unicode not is
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
const DataStore = require('./DataStore');
|
|
const MessageReaction = require('../structures/MessageReaction');
|
|
|
|
/**
|
|
* Stores reactions.
|
|
* @private
|
|
* @extends {DataStore}
|
|
*/
|
|
class ReactionStore extends DataStore {
|
|
constructor(message, iterable) {
|
|
super(message.client, iterable, MessageReaction);
|
|
this.message = message;
|
|
}
|
|
|
|
create(data, cache) {
|
|
return super.create(data, cache, { id: data.emoji.id || data.emoji.name, extras: [this.message] });
|
|
}
|
|
|
|
/**
|
|
* Data that can be resolved to a MessageReaction object. This can be:
|
|
* * A MessageReaction
|
|
* * A Snowflake
|
|
* @typedef {MessageReaction|Snowflake} MessageReactionResolvable
|
|
*/
|
|
|
|
/**
|
|
* Resolves a MessageReactionResolvable to a MessageReaction object.
|
|
* @method resolve
|
|
* @memberof ReactionStore
|
|
* @instance
|
|
* @param {MessageReactionResolvable} reaction The MessageReaction to resolve
|
|
* @returns {?MessageReaction}
|
|
*/
|
|
|
|
/**
|
|
* Resolves a MessageReactionResolvable to a MessageReaction ID string.
|
|
* @method resolveID
|
|
* @memberof ReactionStore
|
|
* @instance
|
|
* @param {MessageReactionResolvable} role The role resolvable to resolve
|
|
* @returns {?string}
|
|
*/
|
|
}
|
|
|
|
module.exports = ReactionStore;
|