-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(interactions): get info from cache first if available #724
Conversation
✅ Deploy Preview for nextcord-gh-action ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
If not all intents are enabled, there may be some events that don't update the cached message I think. Is it possible the interaction message will contain data that is newer/more accurate than the cache? Possibly they may need to be merged together? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think of these suggestions. This should use the cache, but also update any additional fields provided by the interaction data.
I just did it for the sake of "why not".
Same as above, I don't know but if that's true but that doesn't sound good and a potential dataloss. Response to the suggestions: They look good to me, will of course require testing. Will do that when I can, thank you :) |
I believe you are correct since if the member/message is cached at all, it should always update in the corresponding update/edit event, so just using the item from the cache should be enough. |
Summary
Fixes #605
This PR changes the assignment of the following attributes for
Interaction
to try cache before constructing the object:.message, .user
This is needed because fields like
status
are not sent in the Interaction member payload but are usually cached.Preview:
I don't know how to test
.message
and User for.user
but the correct object is returned.Checklist
task pyright
and fixed the relevant issues.