How can i check if a members Is in a guild?

I have guild id and member id, but the member it may not be fetched
5 Replies
d.js docs
d.js docs3y 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.
Jaworek
Jaworek3y ago
get guild then fetch member
Killer Boss Original
but with member fetched, how can i check if it is in the guild? client.guilds.cache.get(db.id).members.fetch(userid) .then(() => { if (!client.guilds.cache.get(db.id).members.cache.get(userid)) { userIsNotInOne = true; userIsNotIn.push(db.id); } }).catch((err) => { userIsNotInOne = true; userIsNotIn.push(db.id); }) @jaw0r3k
Jaworek
Jaworek3y ago
if u fetched member they are in guild else fetch will return error
Killer Boss Original
oh i try
Want results from more Discord servers?
Add your server