mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
* docs: fix documentation in various places All stores: resolveID returns a nullable Snowflake GuildAuditLogs: ActionType also can be ALL MessageEmbed: make files property show up in the docs ClientApplication: resetSecret and resetToken return a promise ClientManager: status is readonly Guild: features is an array of strings and ban no longer accepts a number or string Guild: ban method no longer accepts a string or number GuildMember: ^ RichPresenceAssets: small and large Image are Snowflakes, also fixed parameter documentation for small and large image url method WebhookMessageOptions: file property is no longer a thing * docs: improve GuildAuditLogs documentation Prefix types with AuditLog to avoid confusion Document GuildAuditLogs' static Targets and Actions properties and add necessary typedefs Use typdefs over primitives where possible. * fix documentation for Guild#defaultRole
45 lines
1.2 KiB
JavaScript
45 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 {?Snowflake}
|
|
*/
|
|
}
|
|
|
|
module.exports = ReactionStore;
|