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

110
Views
PermissionOverwrites throws TypeError

I was trying to create a channel with the following properties:

interaction.guild.channels.create("candidatura_"+interaction.user.username, {
        type: "text",
        topic: `User ID: ${interaction.user.id}`,
        parent: "973307350947594310", //Settare la categoria,
        permissionOverwrites: [
            {
                id: interaction.guild.id,
                deny: ["VIEW_CHANNEL"]
            },
            {
                id: interaction.user.id,
                allow: ["VIEW_CHANNEL"]
            },
            { //Aggiungere altri "blocchi" se si vogliono dare permessi anche a ruoli o utenti
                id: "958431471952101386",
                allow: ["VIEW_CHANNEL"]
            }
        ]
    })

The problem is, the following code throws a TypeError, the error is the following:

/home/luca/Bot Discord/TicketBot/node_modules/discord.js/src/structures/PermissionOverwrites.js:184
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
                       ^
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.

Does anyone have any idea of what the problem could be? I tried removing the permissionOverwrites parameter and it works fine, but of course I want the permissions to be set.

about 4 years ago · Juan Pablo Isaza
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!