Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
roleUpdate Event Running When Changing Role Position Discord.JS

I have this code that gets sent when a roles permissions gets updating but its gets sent when moving a role and the permissions are the same, why is this happening?

module.exports = async (client, oldRole, newRole) => {
    const allLogs = await newRole.guild.fetchAuditLogs({ type: "ROLE_UPDATE" });
    const fetchModerator = await allLogs.entries.first();
    if (oldRole.permissions !== newRole.permissions) {
        const embed = new Discord.MessageEmbed()
            .setAuthor({ name: fetchModerator.executor.tag, iconURL: fetchModerator.executor.displayAvatarURL({ dynamic: true }) })
            .setTitle('Role Permissions Updated')
            .setColor(config.colour)
            .setTimestamp()
            .addFields(
                {
                    name: "__Role__",
                    value: `<@&${newRole.id}>`,
                    inline: true
                },
                {
                    name: "__Old Perms__",
                    value: oldRole.permissions.toArray().join('\n'),
                    inline: true
                },
                {
                    name: "__New Perms__",
                    value: newRole.permissions.toArray().join('\n'),
                    inline: true
                },
                {
                    name: "__Updater__",
                    value: `<@${fetchModerator.executor.id}>`,
                    inline: true
                }
            )
        return logChannel.send({ embeds: [embed] })
    }
}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda