Jakub „Jaczup”
Jakub „Jaczup”
DIAdiscord.js - Imagine an app
Created by Jakub „Jaczup” on 8/3/2024 in #djs-questions
Problem with fetching members with roles
const TEAM = ['1268886403756982312','1268886902879027220','1268886992150728774','1268887041559494721','1268887056961241129','1268887071372738592'];

const fetchedMembers = await interaction.guild.members.fetch();
const adminMembers = fetchedMembers.filter(member => {member.roles.cache.some(role => TEAM.includes(role.id))});
const TEAM = ['1268886403756982312','1268886902879027220','1268886992150728774','1268887041559494721','1268887056961241129','1268887071372738592'];

const fetchedMembers = await interaction.guild.members.fetch();
const adminMembers = fetchedMembers.filter(member => {member.roles.cache.some(role => TEAM.includes(role.id))});
Can someone help with this? It returns me empty collection every time even when member have a role.
7 replies