how can i search for a member using an id?

i did this but not working v14.7.1
14 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
ARH
ARH12mo ago
var member = interaction.guild.members.get(discordID);
var member = interaction.guild.members.get(discordID);
Danial
Danial12mo ago
interaction.guild.members.fetch("id") and resolve the promise it returns You're trying to do interaction.guild.members.cache.get() but not all members will be cached so fetch instead
ARH
ARH12mo ago
and if i do member.roles.add(roleID) will work?
Danial
Danial12mo ago
Yes
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
ARH
ARH12mo ago
i have about 52 discord id, i want to give them roles in a very fast way so i am just trying to make a script
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
ARH
ARH12mo ago
thanks
treble/luna
treble/luna12mo ago
do note that giving 52 members a role at once will get you ratelimited
d4
d412mo ago
by this explanation it seems like a one-time script
ARH
ARH12mo ago
i made an exam for our candidates and 52 one passed the exam i want to give them access for the phase 2 channels
ARH
ARH12mo ago
i did this, thanks!
ARH
ARH12mo ago
it is