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

179
Vistas
reading status and giving user role

I have a command that gives a user a role if they have .gg/ in their custom status. There are no error logs but the bot is not giving the role to the users who have this as their status.

client.on('presenceUpdate', async (oldPresence, newPresence) => {
    const role = newPresence.guild.roles.cache.get('726517660279373986');
    const member = newPresence.member;
    const activities = member.user.presence.activities[0];

    if (activities && (activities.state.includes('.gg/') || activities.state.includes('discord.gg/'))) {
        return newPresence.member.roles.add(role);
    }
    else if (member.roles.cache.get(role.id)) {
        newPresence.member.roles.remove(role);
    }
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Gateway Intents were introduced by Discord so bot developers can choose which events their bot receives based on which data it needs to function. Intents are named groups of pre-defined WebSocket events, which the discord.js client will receive.

You need the privileged GUILD_PRESENCE Intent to be enabled for setting up a functional presenceUpdate listener.

You may enable it by going to the Discord Developer Portal > Your Application > Bot > ( Scroll down and locate privileged intents ) > Turning on Presence intent.

This is what you'd be looking for:
here's what you're looking for

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