#From roles to embed

8 messages · Page 1 of 1 (latest)

alpine mulch
#

• 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.

ebon wasp
#

What is this code even supposed to do

#

I dont really get the point of that for loop

#

member.roles.cache is already a collection of the member roles so why do you iterate the positions too

ebon wasp
#

Yeah so member.roles.cache is already a collection of roles

#

You dont need that for loop for anything

royal plume
#

If you want to sort roles by position. There're <Collection>.sort() and <Collection>.sorted().
cache is the Collection.

ruby jettyBOT
#

method Collection#sort()
The sort method sorts the items of a collection in place and returns it. The sort is not necessarily stable in Node 10 or older. The default sort order is according to string Unicode code points.