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

It doesn't cache/load every user. #29

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

It doesn't cache/load every user. #29

real2two opened this issue Sep 10, 2021 · 2 comments

Comments

@real2two
Copy link
Contributor

Please describe the bug or issue in as much detail as possible:
msg.author is sometimes undefined because it cannot find the user. It seems like the user isn't being cached, therefore the object is undefined. (there should seriously be a fetch user by ID API endpoint.)

Please include a reproducible code sample here, if possible:
msg.author and etc are undefined.

Further details:

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

Workaround
A workaround for this issue is to DM the bot before you send a message to them. The bot needs to have an open DM with the user, then restart the bot. (on startup)

@real2two
Copy link
Contributor Author

real2two commented Sep 12, 2021

So, a friend of mine told me a fix, which is to add some code right after this line:

this.cache = cache;

setInterval(() => { this.cache = cache }, 500); // you can change the 500.

But, I don't know if they are going to push it himself.

@real2two
Copy link
Contributor Author

well, the thing i wrote above sometimes works but not always

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