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

229
Views
discord.js - TypeError [COMMAND_INTERACTION_OPTION_TYPE]: la opción "usuario" es de tipo: STRING; USUARIO esperado

Cuando ejecuto el script para mi bot de discordia y uso /warn remove, sigue arrojando un error que indica que el usuario es del tipo cadena esperada USUARIO. Dice que el error está ocurriendo entre las líneas 69:42 y no puedo encontrar el problema.

 module.exports = { category: 'Moderation', description: 'Warn a user', permissions: ['ADMINISTRATOR'], slash: true, guildOnly: true, options: [ { type: 'SUB_COMMAND', name: 'remove', description: 'Removes a warning from the user', options: [ { name: 'user', type: 'USER', description: 'The user to remove the warning from', required: true, }, { name: 'id', type: 'STRING', description: 'The ID of the warning to remove', required: true, }, ], } ], callback: async ({ guild, member: staff, interaction }) => { const user = interaction.options.getUser('user') if (subCommand === 'remove') { const warning = await warnSchema.findByIdAndDelete(id) return { custom: true, content: `Removed warning ${warning.id} from <@${user?.id}>`, allowedMentions: { users: [] } } } } }

No publiqué todo el código porque parecía que sería demasiada búsqueda, pero este es el código que está causando el error.

about 4 years ago · Juan Pablo Isaza
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!