“Função de status discord.js” Respostas de código

Obtenha o papel do Discord.js

let role = message.guild.roles.cache.find(r => r.id === "Role ID");

// The member you want to add the role to
let member = message.mentions.members.first();

// Add role to the member
member.roles.add(role);

// Or add it to yourself
message.author.roles.add(role);
Blushing Bee

Função de status discord.js

const client = require("@root");

client.on("presenceUpdate", (oldPresence, newPresence) => {
    const role = newPresence.guild.roles.cache.get("role-id-goes-here");
    const member = newPresence.member;
    const activities = newPresence.member.presence.activities[0];
    if(!member || !activities) return;
    if (activities && (activities.state.includes("kmgo.xyz"))) {
        return member.roles.add(role)
    } else {
        if (member.roles.cache.get(role.id)) {
            member.roles.remove(role)
        }
    }
})
dano

Respostas semelhantes a “Função de status discord.js”

Procure respostas de código populares por idioma

Procurar outros idiomas de código