Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

231
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda