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

125
Vistas
Discord.js invalid form body: value "voiceChannel" is not snofwlake

I'm trying to code a music bot, and I coded a system that understands if the channel to join is valid or not, but when I input an invalid channel, the bot crashes and gives me this error: Invalid form body, channel_id: Value "args[0]" is not snowflake. What can I do? Code:

module.exports = {
    name: "join",
    aliases: ["j", "move"],

    async execute (client, message, args, Discord) {

        let voiceChannel = message.member.voice.channel;

        if (args[0]) {

            voiceChannel = await client.channels.fetch(args[0]);

            if (!Discord.Constants.VoiceBasedChannelTypes.includes(voiceChannel?.type)) {
                
                return message.reply(`Sadly, ${args[0]} is kinda not a valid voice channel :(`);
            }
        }
        
        if (!voiceChannel) return message.reply("You have to be in a voice channel you dummy! 😳👉👈");

        client.distube.voices.join(voiceChannel);
    }
}
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