Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda