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

241
Visualizações
Renew Bot Cache Discord.js v12

I have simple code, that checks if a user has an specific role:

message.member.roles.cache.some(role => role.id === 'role_id')

The problem is now, that when I change the roles, so remove the specific role while the bot is running, the user still has the rights. So in the Bot Cache, the user still has the specific role.

Is there any way to renew the bot cache when user roles change?

Thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

GuildMemberManager.fetch updates the cache. Simply do this above that statement:

await message.guild.members.fetch();
//rest of code with cached members
about 4 years ago · Juan Pablo Isaza Relatório
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