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

121
Visualizações
How the bot mention people if someone boost/unboost the server

My bot sends the message if someone boosts/unboosts the server.

You can see my code here:

client.on("guildMemberUpdate", (oldMember, newMember) => {
  const oldStatus = oldMember.premiumSince;
  const newStatus = newMember.premiumSince;

  if (!oldStatus && newStatus) {
    client.channels.cache
        .get("channel id")
        .send(`Thank you ${newMember.user.tag} (:`);
  }

  if (oldStatus && !newStatus) {
    client.channels.cache
        .get("channel id")
        .send(`woah ${newMember.user.tag}, unboost this server`);
  }
});

The code works perfectly, there is no error, but the bot is not tagging people, just mentioning the tag name like this:

enter image description here

I want the bot to mention people like this instead:

enter image description here

I think the problem is ${newMember.user.tag}. Usually, I use <@${member.id}>, but I don't know how to fix this code if using {user.tag}.

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

0

You can either use:

.send(`woah <@${newMember.id}>, unboost this server`)

or simply:

.send(`woah ${newMember}, unboost this server`)

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