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

136
Vistas
How to track who invited a bot with discord.js?

How to track who invited a Discord bot in a guild, using discord.js? I want to create an anti-bot event and take action against the inviter.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Using audit logs will suffice (you will need to give the bot perms). Using GuildAuditLogsEntry.executor and GuildAuditLogsEntry.target. Here is an implementation (it will check if the member is a bot and if they are, do something of your choice)

client.on("guildMemberAdd", async (member) => {
  if (!member.user.bot) return;
  const auditLogs = await member.guild.fetchAuditLogs({type: "BOT_ADD"})
  const auditLog = auditLogs.entries.first()
  //you can take ban with "auditLog.executor.ban()"
  //you can also ban the bot with "auditLog.target.ban"
})

Tested on discord.js v13

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