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

oldPresence is undefined if member was offline (since new presence update) #3221

Closed
1 task done
moonstar-x opened this issue Apr 19, 2019 · 1 comment
Closed
1 task done

Comments

@moonstar-x
Copy link

moonstar-x commented Apr 19, 2019

Please describe the problem you are having in as much detail as possible:
Since the presence update done in #3214, the old presence object is undefined when the member who's presence changed was offline. It seems this happens only when the client first sees this change (meaning if the client never saw the members being online in the first place), then it seems like the presence updates are correct afterwards.

It doesn't seem too 'game-breaking' but I thought that maybe this wasn't intended.

Include a reproducible code sample here, if possible:

client.on('presenceUpdate', (oldPresence, newPresence) => {
    console.log(JSON.stringify(oldPresence));
    console.log(JSON.stringify(newPresence));
});

Further details:

  • discord.js version: master
  • Node.js version: 10.13
  • Operating system: macOS Mojave 10.14.4
  • Priority this issue should have – please be realistic and elaborate if possible: low
  • I have also tested the issue on latest master, commit hash: cde955c
@amishshah
Copy link
Member

This is intended to help you differentiate between users who were definitely offline and cases where Discord.js never had their presence in the first place.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants