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

144
Visualizações
How Can I run a user command by using their ID (Ex - /ban 696053906010276010)?
let fUser = message.guild.member(message.mentions.members.first() || message.guild.members.cache.get(args[0]))

if (!fUser) 
    return message.channel.send("Please put a valid member or a user ID for me to strike").then(msg => msg.delete({ timeout: 8000 })).catch(console.error);

How can I like ban someone using their id cause currently how my user variable is setup is it only allows me to ban them by mentioning but I want to be able to ban them by ID instead the only way I can do that right now to replace "user" with their id like this <@716382720917372998>.

But I just want to put in there raw ID and it works out.

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

0

In order to ban a user by their ID you have to do the following :

const member =  message.mentions.members.first() || await message.guild.members.fetch(args[0]);

Here the member variable is an GuildMember so you can just do member.ban() to ban them.

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