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 toolkit2y 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
ARHOP2y ago
var member = interaction.guild.members.get(discordID);
var member = interaction.guild.members.get(discordID);
Danial
Danial2y 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
ARHOP2y ago
and if i do member.roles.add(roleID) will work?
Danial
Danial2y ago
Yes
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
ARH
ARHOP2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
ARH
ARHOP2y ago
thanks
treble/luna
treble/luna2y ago
do note that giving 52 members a role at once will get you ratelimited
d4
d42y ago
by this explanation it seems like a one-time script
ARH
ARHOP2y 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
ARHOP2y ago
i did this, thanks!
ARH
ARHOP2y ago
it is
Want results from more Discord servers?
Add your server