Skip to content
Advertisement

Discord.js remove roles

I have this issue on my bot command. It doesn’t remove any other specified roles other than the first defined one.

JavaScript

This is the part where everything is defined.

Advertisement

Answer

Your callback function for find() is incorrect, and actually find() returns the first found element in an array. You could use .filter() to get a collection of elements instead and use the .includes() method to check if the role name is in the list provided.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement