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

@@ -9,8 +9,8 @@ discard the event. With partials, you're able to receive the event, with a Messa
Partials are opt-in, and you can enable them in the Client options by specifying [PartialTypes](../typedef/PartialType):
```js
// Accept partial messages, DM channels, and reactions when emitting events
new Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });
// Accept partial messages and DM channels when emitting events
new Client({ partials: ['MESSAGE', 'CHANNEL'] });
```
## Usage & warnings
@@ -45,10 +45,6 @@ client.on('messageReactionAdd', async (reaction, user) => {
if (reaction.message.partial) await reaction.message.fetch();
// Now the message has been cached and is fully available:
console.log(`${reaction.message.author}'s message "${reaction.message.content}" gained a reaction!`);
// Fetches and caches the reaction itself, updating resources that were possibly defunct.
if (reaction.partial) await reaction.fetch();
// Now the reaction is fully available and the properties will be reflected accurately:
console.log(`${reaction.count} user(s) have given the same reaction this message!`);
});
```
@@ -62,4 +58,4 @@ bot or any bot that relies on still receiving updates to resources you don't hav
good example.
Currently, the only type of channel that can be uncached is a DM channel, there is no reason why guild channels should
not be cached.
not be cached.