7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Maybe I'm having a delay in receiving the information, is there anything I can do?
If you're able to, try fetching the DB data in a different place so you're making a new query to your DB every time you get the autocomplete interaction
Also, if you could cache the data returned by fetching the discord user, that would save you API calls in the long run
How can I resolve this? using mongodb
Would you have an example?
@Squid
It's a bit more difficult in commonjs than in esm, but I believe something like:
would populate
gg
with the DB documents, then you don't have to re-query your db every time a letter in the autocomplete option changesbut I need to pull it every time to see if there has been a change
no?
yes, you could update that array whenever you make a change elsewhere in your code
using a Collection/Map is probably easier when it comes to replacing old data since you can just
.set()
with the same key and a new value