fix(MessageReaction*Action): correctly cache incoming members and users #4969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please describe the changes this PR makes and why it should be merged:
This PR fixes a bug involving partials around the
messageReactionAdd
event causing it to emit a partial user with an id with the valueundefined
, as well as caching incoming members and users from said event andtypingStart
.The above mentioned bug was caused due to
getUser
being called with a raw user object, rather than an object with anuser_id
key, which it actually is expecting.discord.js/src/client/actions/Action.js
Lines 87 to 90 in b8fd3f6
MESSAGE_REACTION_ADD
, as well asTYPING_START
, emit a member and user, which now will be added to the cache, removing the requirement to enable theUSER
partial type for this event to work on previously uncached users.If these are missing members and users (due to not originating from a guild), they will be passed long to
getUser
as before.Those fields are documented, just not yet implemented by us, see here:
https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields
https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields
Status
Semantic versioning classification: