Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Discord.js no registra nuevos comandos de barra porque los nombres de las aplicaciones deben ser únicos

Discord.js no volverá a registrar mis comandos, a pesar de que no existen. He verificado que los comandos no existen ejecutando:

 rest.get(Routes.applicationCommands(clientId)) .then(data => console.log(data));

siendo la única respuesta []

El error que me sale es este:

 DiscordAPIError[50035]: Invalid Form Body method: 'PUT', url: 'https://discord.com/api/v9/applications/985234455717363762/commands', requestBody: { files: undefined, json: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ] } }

El código ( deploy-commands.js ) se ve así:

 const fs = require('node:fs'); const path = require('node:path'); const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v9'); const { clientId, token } = require('./config.json'); const commands = []; const commandsPath = path.join(__dirname, 'commands'); const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); for (const file of commandFiles) { const filePath = path.join(commandsPath, file); const command = require(filePath); commands.push(command.data.toJSON()); } const rest = new REST({ version: '9' }).setToken(token); rest.put(Routes.applicationCommands(clientId), { body: commands }) .then(() => console.log('Successfully registered application commands.')) .catch(console.error);

Con este árbol de archivos:

 discord-bot/ |-- Commands/ |-- avatar.js |-- beep.js |-- kick.js |-- options-info.js |-- ping.js |-- prune.js |-- server.js |-- user-info.js |-- node_modules |-- config.json |-- deploy-commands.js |-- index.js |-- package-lock.json |-- package.json

¡AYUDA!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Este error aparece si tiene 2 comandos de aplicación con el mismo nombre, verifique dos veces los nombres de sus comandos y asegúrese de que cada comando tenga un nombre único.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!