“Peran Status Discord.js” Kode Jawaban

Dapatkan Peran 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

Peran 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

Jawaban yang mirip dengan “Peran Status Discord.js”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya