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

132
Vistas
Create discord channel with specific roles js
let myRole = message.guild.roles.cache.find(role => role.name === "Admin");
message.guild.channels.create(
  channelName2, 
  {
    type: "GUILD_TEXT",
    permissionOverwrites: [
      {
        id: myRole.id,
        allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
      },
      {
        id: myRole.id,
        deny: ["VIEW_CHANNEL"]
      }
    ]
  }

Bot creates the text channel but has no permissions edited and it ignored almost whatever I write in "id: XXXXXX"

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The problem is the way you are editing the permissions,

First you edit it to allow

    {
        id: myRole.id,
        allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
      }

Then you edit to deny permissions

      {
        id: myRole.id,
        deny: ["VIEW_CHANNEL"]
      }

However by doing it twice you undo the permissions of the first time, the correct way to do it would be by making it into one object:

message.guild.channels.create(
  channelName2, 
  {
    type: "GUILD_TEXT",
    permissionOverwrites: [
      {
        id: myRole.id,
        allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
        deny: ["VIEW_CHANNEL"]
      }
    ]
  }
about 4 years ago · Juan Pablo Isaza Denunciar
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