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

314
Views
Comando de prohibición discord.js (v13)

Hola, he estado tratando de hacer un comando de prohibición con discord.js (v13) pero recibo este error y no sé cuál es la causa del problema.

si alguien me puede ayudar se lo agradeceria mucho

 DiscordAPIError: Invalid Form Body embeds[0].description: This field is required

Mi código :

 module.exports = { name: "ban", description: "This command ban's someone", category: "moderation", example: ["!ban @member"], callback: async ({ message, args }) => { try { const member = message.mentions.members.first(); const permission = message.member.permissions.has("BAN_MEMBERS"); if (!permission) return message.reply( "❌ | You don't have permission to use this command" ); if (!args[0]) return message.reply(`❌ | Please specify someone`); if (!member) return message.reply(`💤 | Cannot find that member...`); if (member.id === message.author.id) return message.reply(`❌ | You cannot ban yourself!`); if (message.member.roles.highest.position < member.roles.highest.position) return message.reply( `❌ | You cannot ban user who have higher role than you...` ); if (!member.bannable) return message.reply(`❌ | I cannot ban that member`); return ( (await member.ban()) + message .reply({ content: `:anger: | User ${member} has been banned`, }) .then((msg) => { setTimeout(() => msg.delete(), 5000); }) ); } catch(err) { message.reply(`awww there was an ${err}`) } }, };
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Si está actualizando discord.js de v12 a v13, asegúrese de tener en cuenta estos cambios: https://discordjs.guide/additional-info/changes-in-v13.html#sending-messages-embeds-files- etc.

La opción de incrustaciones se reemplazó con matrices de incrustaciones, lo que significa que deben estar en el objeto de opciones. Prueba este código:

 module.exports = { name: "ban", description: "This command ban's someone", category: "moderation", example: ["!ban @member"], callback: async ({ message, args }) => { try { const member = message.mentions.members.first(); const permission = message.member.permissions.has(Discord.Permissions.FLAGS.BAN_MEMBERS) if (!permission) return message.reply({ contents: "❌ | You don't have permission to use this command" }); if (!args[0]) return message.reply({ content: `❌ | Please specify someone` }); if (!member) return message.reply({ content: `💤 | Cannot find that member...` } ); if (member.id === message.author.id) return message.reply({ content: `❌ | You cannot ban yourself!` }); if (message.member.roles.highest.position < member.roles.highest.position) return message.reply({ content: `❌ | You cannot ban user who have higher role than you...` }); if (!member.bannable) return message.reply({ content: `❌ | I cannot ban that member`}); return ( (await member.ban()) + message .reply({ content: `:anger: | User ${member} has been banned` }) .then((msg) => { setTimeout(() => msg.delete(), 5000); }) ); } catch(err) { message.reply({ content: `awww there was an ${err}` }) } }, };
about 4 years ago · Santiago Gelvez 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!