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

252
Visualizações
I am trying to make my bot make a new channel with the name of a guild, if it has not already been made

So, this is my bot:

client.on("message", message => {
client.guilds.cache.forEach(guild => {
  const channel = server.channels.cache.find(channel => channel.name == guild.id);
  if(channel) return
  if (!channel) {
    client.guilds.cache.map(guild => server.channels.create(guild.id, {type: 'text'})
      .then(async channel => {
        const category = server.channels.cache.get('CHANNELID')
        channel.setParent(category.id)
      })
    )
  }
});

It can not find the channels, just spam new channels until I turn it off...

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

var schannel = message.guild.channels.cache.find(channel => channel.name === message.guild.name); if(!schannel) return message.reply("Channel not found")
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