Pls use role id. Here's my codeline :
client.on('message', message =>{
let roleID = "786148346846117940";
let memberCount = message.guild.roles.cache.get('roleID').members.size;
console.log(memberCount)
});
I tried this code but somehow even when 1 member has the role it send me:
0
0
But when i am the person who has the role then i get:
1
1