How to make sure that a channels.create call followed by a channels.fetch call is consistent?
Right now I have some code that creates a category and then adds some channels to it. What I've noticed is that there is some sort of race condition.
Whenever I create a new category with
then there is a seemingly random chance that a subsequent
call will not contain the newly created category. How can i make sure that
fetch
is in a happens-before relationship with create
?
Note that I also tried:
to no avail. π¦3 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!
- β
Marked as resolved by OPwhy can't you save the created category in a variable to reuse it?
i figured it out
i'm creating channels in parallel and there is a race condition