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

138
Visualizações
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 Respostas
Responde à pergunta

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 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