revert: "feat(Partials): add DMChannel/MessageReaction#fetch()… (#3468)

This reverts commit b0047c424b.
This commit is contained in:
Crawl
2019-09-10 19:49:56 +02:00
committed by GitHub
parent dad0cd8e81
commit 321beb73bd
9 changed files with 20 additions and 80 deletions

View File

@@ -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;