Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
How can I get intellisense for an object called with an unknown variable?

i'm developing a discord.js bot and I have an object (called dtm) that keeps all users' data. It has this structure:

{
// id of the user : {data}
"92875891383" : {wallet: 100}
}

If in the code I use dtm[interaction.user.id] I don't get intellisense for the user's parameters, I think because intellisense doesn't know what interaction.user.id is. How can I achieve this? I thought with JSDoc, but i don't know quite how to achieve this...

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Found it. I used this JSDoc:

/**
 *
 * @returns {{[key: string] : theSchema}} playerData 
*/

And it finally worked! Thank you

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda