Skip to content
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

guildMemberUpdate does not utilise partials #4975

Closed
1 task
MattIPv4 opened this issue Nov 3, 2020 · 0 comments · Fixed by #4986
Closed
1 task

guildMemberUpdate does not utilise partials #4975

MattIPv4 opened this issue Nov 3, 2020 · 0 comments · Fixed by #4986

Comments

@MattIPv4
Copy link
Contributor

MattIPv4 commented Nov 3, 2020

Please describe the problem you are having in as much detail as possible:

With both the USER and GUILD_MEMBER partial enabled, with the GUILD_MEMEBRS intent, the guildMemberUpdate event does not fire when an uncached user/member changes their nickname. However, it does fire for a fully cached user/member.

I would expect guildMemberUpdate to be able to utilise partials, with only IDs plus the updated value being passed in the objects -- I haven't looked into it much though, so I could be wrong if Discord doesn't send any useful data about the change.

https://github.com/discordjs/discord.js/blob/b8fd3f65d964f080afb42dd37eb21a13c0d84f8f/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js

Include a reproducible code sample here, if possible:

    const client = new Client({
        ws: {
            intents: (new Intents()).add(
                Intents.FLAGS.GUILDS,
                Intents.FLAGS.GUILD_MEMBERS,
            ),
        },
        partials: ['USER', 'GUILD_MEMBER'],
    });
    client.on('guildMemberUpdate', (oldMember, newMember) => console.log(oldMember, newMember));

Update the nickname of another user in a guild that the bot is in, without that user sending any message so they are uncached. Observe no logging.

Update the nickname of yourself after having sent a message in the guild. Observe change logged.

Further details:

  • discord.js version: 12.4.1
  • Node.js version: 12.18.1
  • Operating system: macOS 10.15.7
  • Priority this issue should have – please be realistic and elaborate if possible: P2 - Would be useful considering partials help with memory performance greatly.

Relevant client options:

  • partials: USER, GUILD_MEMBER

  • gateway intents: GUILDS, GUILD_MEMEBRS

  • other: none

  • I have also tested the issue on latest master, commit hash:

@SpaceEEC SpaceEEC linked a pull request Nov 7, 2020 that will close this issue
5 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@MattIPv4 @SpaceEEC and others