Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
I am unable to check if a member has a certain role in Discord.js

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 })
     }
}
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!