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.
6 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Jakub „Jaczup”
Jakub „Jaczup”OP5mo ago
discord.js: 14.14.1, node: 18.20.2
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Jakub „Jaczup”
Jakub „Jaczup”OP5mo ago
Thank u so much, I've done a stupid thing 😂
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Jakub „Jaczup”
Jakub „Jaczup”OP5mo ago
You've been mulling over why it doesn't work for so long, and here's such a silly error xd
Want results from more Discord servers?
Add your server