Randomly Fails at creating roles

I am very new to all of this. Im trying to create roles based on array of objects, meaning the object's name. This was working rather well before. Im not sure what I changed but it seems to fail during the guild.roles.create. Sometimes I get one role, other times I get 5 roles created. All of my passed objects exist and are defined. codeFlow, is just a function that prints to console.
9 Replies
d.js toolkit
d.js toolkit16mo ago
- 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!
SpecialSauce
SpecialSauce16mo ago
And what is being logged to the console?
mh1723
mh1723OP16mo ago
It just stops after the first log to show the object and it's property. Im running it on debug in vs code and looking at the debug output.
SpecialSauce
SpecialSauce16mo ago
Show the console output.
mh1723
mh1723OP16mo ago
Ive run three times just now, and no issue. Is there a limit to how much discord will let you do certain actions? My bot is only in a test server
SpecialSauce
SpecialSauce16mo ago
There are rate limits yes. If you’re trying to create too many roles at once that would be a possibility.
d.js docs
d.js docs16mo ago
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
client
.on("debug", console.log)
.on("warn", console.log)
client
.on("debug", console.log)
.on("warn", console.log)
- Note: if you initialize your Client as bot or other identifiers you need to use these instead of client - If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebin
SpecialSauce
SpecialSauce16mo ago
Those may help figure out if it’s a rate limit issue.
mh1723
mh1723OP16mo ago
ahhhh, I will add those thank you!
Want results from more Discord servers?
Add your server