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

341
Vistas
How to fix slash commands disappearing after one use

Hi I added slash commands for the first time in js and like after one use the commands disappear as shown in the video below

Video url

    
    // Slash Commands
    const slashCommands = await globPromise(
        `${process.cwd()}/SlashCommands/*/*.js`
    );

    const arrayOfSlashCommands = [];
    slashCommands.map((value) => {
        const file = require(value);
        if (!file?.name) return;
        client.slashCommands.set(file.name, file);

        if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
        arrayOfSlashCommands.push(file);
    });
    client.on("ready", async () => {
        // Register for a single guild
        await client.guilds.cache
            .get("900379296407896075")
            .commands.set(arrayOfSlashCommands);
      console.log('[Slash cmds] commands were loaded')

        // Register for all the guilds the bot is in
        // await client.application.commands.set(arrayOfSlashCommands);
    });```

slash command handler that I use 
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to redeploy your bot making sure that you have selected bot and application.commands, then set the permissions and use the link at the bottom to re-invite your bot to the guild.

See picture below: discord.dev

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