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
• 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.get guild then fetch member
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
if u fetched member they are in guild
else fetch will return error
oh
i try