I'm trying to see if a user has a role with discordjs v13. I'm using typescript as well.
On multiple posts, I've seen people use this code:
function handleCommand(interaction: CommandInteraction) {
...
let isAdmin = interaction.member.roles.cache.some(role => role.name === 'Admin')
...
However, I get an error:
Property 'cache' does not exist on type 'string[]'.
22 console.log(interaction.member.roles.cache.some((r) => r.name == "Admin"));
~~~~~
What is the correct way to do this?