I have an array with all the roles in a discord server, and I want to filter it to show me only the roles which have a specific name. I've used the filter() function before for filtering members with a specific role, but I am having trouble adapting it to this situation.
The code for filtering a list of members:
const membersWithRole = members.filter(m => !!m.roles.find(r => r === sheet.rows[i].fields.role_id));