mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
refactor: more oop with stores (#2216)
* refactor: more oop with stores * forgot bulk delete * Revert "forgot bulk delete" This reverts commit 1b4fb999ee07b358ee6e1af9efb8981b84f83af1. * appease linter * missed some shh * fail
This commit is contained in:
@@ -12,8 +12,8 @@ class ReactionStore extends DataStore {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
create(data, cache) {
|
||||
return super.create(data, cache, { id: data.emoji.id || data.emoji.name, extras: [this.message] });
|
||||
add(data, cache) {
|
||||
return super.add(data, cache, { id: data.emoji.id || data.emoji.name, extras: [this.message] });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,15 @@ class ReactionStore extends DataStore {
|
||||
* @param {MessageReactionResolvable} role The role resolvable to resolve
|
||||
* @returns {?Snowflake}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Removes all reactions from a message.
|
||||
* @returns {Promise<Message>}
|
||||
*/
|
||||
removeAll() {
|
||||
return this.client.api.channels(this.message.channel.id).messages(this.message.id).reactions.delete()
|
||||
.then(() => this.message);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ReactionStore;
|
||||
|
||||
Reference in New Issue
Block a user