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

242
Visualizações
Discord.js || Can bot track ban list?

There are a lot of to ban a user in a server, you can do it manually or with another bot. I want my bot to scan a banlist, and if someone will get banned, it will send a message "user (id) has been banned

I started writing smt but now, I had no idea what can I do to check it. EDIT: It's working now, but it still need to find this user id.

client.on('guildBanAdd', message => {
  client.user.cache.find() //idk how to define it
  const channel1 = client.channels.cache.find(channel => channel.id === "158751278127895");
  channel1.send('12512');
  
})
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You don't have to fetch bans because the guildBanAdd event parses a GuildBan object,
which als includes a User object.

client.on('guildBanAdd', ban => {
    console.log(ban.user.username); // Username
})
  • message.channel won't work because there isn't a message object.

If you want to get the executor (moderator) who performed the ban, kick etc.
There is a good guide for this Working with Audit Logs

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