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

151
Views
TypeError: no se pueden leer las propiedades de undefined (leyendo 'miembro')

¿Alguien puede ayudarme a resolver este error? Realmente no sé qué hacer. Hice todo lo posible para deshacerme de este error, pero nada funcionó. Te estaré muy agradecido si intentas ayudarme. Se supone que este código le brinda información básica sobre el usuario al que hizo ping. ingrese la descripción de la imagen aquí

 const Command = require("../Structures/Command.js"); /** * @param {Client} client * @param {Message} message * @param {String[]} args */ module.exports = new Command({ name: "userinfo", description: 'info', async run(client, message, args) { const user = message.mentions.member.first() || message.member.user.username; const member = message.guild.members.cache.get(user.id); const embed = new MessageEmbed() .setColor('DARK_RED') .setAuthor({ name: user.username, iconURL: user.avatarURL({ dynamic: true }) }) .setDescription("Kdo to je") .setThumbnail(user.displayAvatarURL({ dynamic: true })) .addFields( { name: "Username", value: user.username, inline: true }, { name: "Tag", value: user.discriminator, inline: true }, { name: "Bot", value: user.bot, inline: true }, { name: "Nickname", value: member.nickname || "None", inline: true }, { name: "Joined:", value: new Date(member.joinedTimestamp()).toDateString(), inline: true }, { name: "Discord user since:", value: new Date(user.createdTimestamp()).toDateString(), inline: true }, { name: "Roles count:", value: member.roles.cache - 1, inline: true }, ) return message.channel.send({ embeds: [embed] }); } })

También estoy compartiendo mi controlador de comandos simple, porque se usa en este código.

 const Client = require("./Client.js"); /** * @param {Discord.Message} message * @param {string[]} args * @param {Client} client */ function RunFunction(message, args, client) {} class Command { /** * @typedef {{name: string, description: string, run: RunFunction}} CommandOptions * @param {CommandOptions} options */ constructor(options) { this.name = options.name; this.description = options.description; this.permission = options.permission; this.run = options.run; } } module.exports = Command;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Uno de los siguientes no contiene objeto:

message.mentions.member o message.member o message.guild.members

Por lo tanto, cuando intenta acceder, es decir message.mentions.member.first() , falla, porque intenta llamar a algo como undefined.first()

Debe registrar (o depurar) el parámetro de message completo y ver qué hay realmente dentro.

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!