-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(Interactions)!: member objects for uncached guilds #10195
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
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.
There's a LOT of inconsistencies between trying to make this a non-semver major change (by also having snake_case properties) and a semver-major change (by not exposing all values under the same name). Let's pick one side (and gut says you want this in a sem-minor 👀) and roll with it!
nick
isn't exposed asnick
, onlynickname
data.roles
isn't exposed at all, only asroleIds
- this one I understand why, but I'd at least try to make uncachedMember.roles be our role manager (it should work)
Co-Authored-By: Vlad Frangu <[email protected]> Co-Authored-By: Qjuh <[email protected]>
Marking the PR as both sem minor and major until I test it out and ensure this is a sem-minor PR 👀 |
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.
Thoughts on an AnyGuildMember
type which is union of both Uncached and GuildMember and we have functions that assert whether a member instance is the uncached one?
Since this PR targets d.js v15 now, I've done some changes:
|
Please describe the changes this PR makes and why it should be merged:
fixes #10010
Discord thread
Currently, when an interaction is received from a guild that isn't cached*, raw API member objects are returned instead of a d.js GuildMember object. This PR creates a new MinimalGuildMember object that is returned instead of raw API member objects.
This new object tries to be compatible with GuildMember, but retains backwards compatibility with APIGuildMember as to not make this a breaking change. Therefore it is still somewhat awkward and not great, but it is much better than just receiving an APIGuildMember. Hopefully in v15 we can remove the backwards compatibility and align it better with GuildMember.Since we're targeting v15 now, this PR updates GuildMember to extend MinimalGuildMember. all fields that do not require the guild are in MinimalGuildMember, and GuildMember adds the fields that use the cached guild.
This has not been fully tested and likely needs changes - please thoroughly review!
* This was always possible by adding apps with only the applications.commands scope, but user apps makes this a much more common appearance. This PR is based on the discord.js patch AdvaithBot is running to properly handle user app commands.
Status and versioning classification: