check if author of message has roleId

if (message.guild.members.cache.get(message.author).roles.cache.has(roleID)) {
TypeError: Cannot read properties of undefined (reading 'roles')

How can i have a member object with my author and then check if he has a role ?
Was this page helpful?