I am working on a bot, that has a request interaction and I want to check if the user interacting has a certain role. I keep getting this crash:
TypeError [INVALID_TYPE]: Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes.
Here's the code:
client.on("interactionCreate", interaction => {
if (interaction.isButton() && interaction.customId === 'request') {
if (interaction.member.roles.cache.find(r => r.id === 'ROLEID') {
const bannedRequestEmbed = {
"title": "Request",
"description": "Sorry, but you are no longer allowed to send requests.",
"color": 16711680}
interaction.reply({ embeds: [bannedRequestEmbed], ephemeral: true })
}
}