mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
revert: "feat(Partials): add DMChannel/MessageReaction#fetch()… (#3468)
This reverts commit b0047c424b.
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user