Fetching Roles
Hey , im trying to fetch all roles in discord with a specific name , hmmi guess im kinda doing right but i cant undrestand the result
16 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.sry cant upload a photo -_-
the result is smth like this
so i was doing right most of the part/
anyone know why these lines of code is using 100% of my server cpu
and it takes like 15 second to execute the command
ive used the same code for channels ( to find channels with a specific name ) and its working fine.
but this one is overusing my cpu
How many roles do you have versus channels?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yeah guilds intent is enabled.
Owky dowky ill try it
hey , i changed fetch to cache the command is working the same like before ( it still replies after like 15 seconds and it uses 100% cpu )
we have a lot of channels and a lot of roles honestly
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
https://sourceb.in/jpxNE67qR2
here u go 🙂
the part which i use a "user" to see a specific user followers works perfectly fast
only the part where its without the "user" and its supposed to show like a leaderboard is going slow
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
its weird actually since ive sone some similar thing like this but for the text chaannels
and it works super fast
without using 100% cpu
im changing 1 line of it , idk i cant think of anything actually it might work lol
nope
hey i used this line of code
so before each line of doing anything i have a log
wanted to check where it stops actually and takes time
its sorting part
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
sadly its the same
:((
ok i managed to change some part
and make the code
to execute in 3 secon
it still goes to 100% cpu but like for very shorter time