I have simple code, that checks if a user has an specific role:
message.member.roles.cache.some(role => role.id === 'role_id')
The problem is now, that when I change the roles, so remove the specific role while the bot is running, the user still has the rights. So in the Bot Cache, the user still has the specific role.
Is there any way to renew the bot cache when user roles change?
Thanks in advance
GuildMemberManager.fetch updates the cache. Simply do this above that statement:
await message.guild.members.fetch();
//rest of code with cached members