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

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