mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
revert: "feat(Partials): add DMChannel/MessageReaction#fetch()… (#3468)
This reverts commit b0047c424b.
This commit is contained in:
@@ -50,28 +50,6 @@ class ReactionStore extends DataStore {
|
||||
return this.client.api.channels(this.message.channel.id).messages(this.message.id).reactions.delete()
|
||||
.then(() => this.message);
|
||||
}
|
||||
|
||||
_partial(emoji) {
|
||||
const id = emoji.id || emoji.name;
|
||||
const existing = this.get(id);
|
||||
return !existing || existing.partial;
|
||||
}
|
||||
|
||||
async _fetchReaction(reactionEmoji, cache) {
|
||||
const id = reactionEmoji.id || reactionEmoji.name;
|
||||
const existing = this.get(id);
|
||||
if (!this._partial(reactionEmoji)) return existing;
|
||||
const data = await this.client.api.channels(this.message.channel.id).messages(this.message.id).get();
|
||||
if (!data.reactions || !data.reactions.some(r => (r.emoji.id || r.emoji.name) === id)) {
|
||||
reactionEmoji.reaction._patch({ count: 0 });
|
||||
this.message.reactions.remove(id);
|
||||
return existing;
|
||||
}
|
||||
for (const reaction of data.reactions) {
|
||||
if (this._partial(reaction.emoji)) this.add(reaction, cache);
|
||||
}
|
||||
return existing;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ReactionStore;
|
||||
|
||||
Reference in New Issue
Block a user