#Select Menu Loops for Role Giving
1 messages · Page 1 of 1 (latest)
That sentence now includes: for, forEach, if, else, else if. It didn’t make anything clearer by that
Okay lemme summary it. I'm trying to check if the user has the roles in the array; it will remove it from the user. If they dont, it will just end the checking.
Okay, so filter the array and at the end of the function check if length > 0 and remove in that case only
That was just shortening the code :D I just wanted to hear your opinion since too many ifs can make the bot go slow, slow...
I know, but does your code contain a for loop? Does it contain a forEach? If not then replacing those words with synonyms would have made it easier to understand
It does not contain any loops, but it would be better than checking bunch of roles with .has() method.
You can do the .has check in the .filter, so one line only
But won't that be only for the item itself?
The filter gets called for every item in the array
Hmm...