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

265
Vistas
How to get user activities from interaction in Discord.js v13?

How can I get the activities from interaction.options? If I use interaction.options.getUser, I receive the following error:

cannot read properties of undefined (reading 'activities')

Here is my code:

const user = interaction.options.getUser('target');

const activity = user.presence.activities.type;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Users don't have a presence property, only GuildMembers have. What you can do is to fetch the member by its ID first:

const user = interaction.options.getUser('target');
const member = await interaction.guild.members.fetch(user);

And then, you can get the activities:

const activities = member.presence?.activities;

activities returns an array of Activity, so you'll need to grab the first one for example to log its type:

console.log(activities[0]?.type)

Please note that you'll need to have the GUILDS, GUILD_MEMBERS, and GUILD_PRESENCES intents enabled!

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