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

253
Vistas
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 Respuestas
Responde la pregunta

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 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