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

153
Vistas
Why slash command discordjs not register

I'm tired of this because I can't fix it. It doesn't register. I will follow this gudie https://discordjs.guide/interactions/registering-slash-commands.html#global-commands

const command = require(path.join(__dirname, '..', 'commands', 'slash') + '/' + files)
       console.log(command.name + " Is Register")
       let cmd = command.register();
       commandsList.push(cmd)
       console.log(commandsList)
       const rest = new REST({ version: '9' }).setToken(token);
       (async () => {
         try {
           console.log('Started refreshing application (/) commands.');
       
           await rest.put(
             Routes.applicationCommands("894136598982180905"),
             { body: commandsList },
           );
       
           console.log('Successfully reloaded application (/) commands.');
         } catch (error) {
           console.error(error);
         }
       })();

I will log SlashCommandBuilder show this commandsList

[
 {
   name: 'ping',
   description: 'Ping Commands',
   options: [],
   default_permission: undefined
 }
]

Slash Command Builder File

const { SlashCommandBuilder } = require('@discordjs/builders');


module.exports = {
 name: "Ping",
 register() {
   const data = new SlashCommandBuilder().
   setName("ping")
   .setDescription("Ping Commands")
   .toJSON();
   return data;
 },
};

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As MrMythical correctly mentioned, most commonly it happens when you didn't give application. commands scope for the bot's invite link.
If it's your case - kick the bot from your server, and create a new link with bot and application. commands scopes, give proper permission set and re-invite it again.
But I've just had the same issue even though it was properly invited (and has worked before). For me, the solution was to regenerate the Token at Discord Developer Portal and restart the bot with the new token. After that - it again works like a charm.

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