#Track user activity (Discord.js / ActivityType)

4 messages · Page 1 of 1 (latest)

marble nest
#

I was able to track one specific activity without ActivityType, but when it came to multiple it would get messy

#

I just can't get enough info on how it is used 😅

marble nest
#

I'm starting to think ActivityType is only to set the bot's activities and not track others? not sure

marble nest
#
client.on('presenceUpdate', (oldPresence, newPresence) => {
    let member = newPresence.member;
    let activity = member.presence.activities[0];
    let channel = member.guild.channels.cache.get('1256434415790194799');

    if (member.id === '418119204978425861') {
        if (!member.presence.activities || member.presence.activities.length == 0) {
            channel.send("@marble nest Antonio no está jugando a nada.");
        } else if (activity.type.toLowerCase() === "playing") {
            channel.send(`@marble nest Antonio está jugando a ${activity.name}.`);
            
        }
    }```
this is the version I get it to work, but if I want to track also the custom activity, they overwrite each other