#From roles to embed
8 messages · Page 1 of 1 (latest)
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
Yeah so member.roles.cache is already a collection of roles
You dont need that for loop for anything
If you want to sort roles by position. There're <Collection>.sort() and <Collection>.sorted().
cache is the Collection.
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.