How to check if user has a role?
I'm trying to like below
But It didnt work... Is it old version code ? (
const userHasRole = member.roles.some(r => roleIds.has(r));
)7 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
member.roles.cache.has(roleId)
and you’re trying to add a role when the member is leaving
which makes no senseIt works perfectly haha Thank youuuu
no prob
🙂
Can I ask more? how to ban that user from server?
member.guild.bans.create(member)
Thank uuu