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

130
Views
discord.js cliente.usuarios indefinidos

Tengo un comando de lista negra y el comando da un error a pesar de que intenté muchas cosas.

  • Discord.js versión: 13.6.0

  • Versión de Node.js: 16.13.2

    Código de comando:

     const { MessageEmbed } = require('discord.js'); module.exports = { name: 'karaliste', description: 'kara', async execute(message, client, args) { const user = message.mentions.users.first() || await client.users.resolve(args.slice(1).join(' ')); if (!user) return message.channel.send(`Karalisteye alınacak kişi belirt!`); if (user) { client.karalistedb.set(user.id, true); return message.channel.send(`\`${user.tag}\` Karalisteye alındı\nSebep: ${message.content.split(' ').slice(1)}`); } } };

    Error:

     Unhandled promise rejection: TypeError: Cannot read properties of undefined (reading 'resolve') `

``

¿Cómo puedo solucionar esto?

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

0

Las propiedades de client.users son cache y client .

Por lo tanto, necesitaría que el cliente busque en el caché al usuario

 client.users.cache.resolve(args.slice(1).join(' '));
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!