I want to check if a user has a role but when I try to get the user is always returns the bots user not the wanted users user. how can I go about fixing this
const member = client.guilds.cache.get(localVars.ServerID).members.cache.find((member) => {
console.log(member.username)
return member.username == localVars.username
})
const role = client.guilds.cache.get(localVars.ServerID).roles.cache.find((role) => {
return role.name === localVars.RoleName
})
console.log(member)
if(member.roles.cache.get(role.id)){
localVars.ReturnValue = 1
} else {
localVars.ReturnValue = 0
}
-Meepso
Aucun commentaire:
Enregistrer un commentaire