Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.

client.users.get(undefined) is defined. #28

Open
real2two opened this issue Sep 10, 2021 · 0 comments
Open

client.users.get(undefined) is defined. #28

real2two opened this issue Sep 10, 2021 · 0 comments

Comments

@real2two
Copy link
Contributor

Please describe the bug or issue in as much detail as possible:
I was making an all cached users list using client.users.size, but the value was 3, when it should've been 2. Doing a bit more debugging, I figured out undefined was part of the client.users map, which could be found with client.users.get(undefined). The value of it was the bot itself.

Please include a reproducible code sample here, if possible:

client.users.get(undefined);

Further details:

  • Installed hiven.js version: ^2.0.11
  • Installed Node.js version: v14.17.0
  • Operating system: Windows 10

Workarounds

For any other Hiven bot developer struggling with this problem to get the maximum user size, I'm just using ${ client.users.get(undefined) ? client.users.size - 1 : client.users.size } for now to find the total user count.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant