Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

136
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda